From e8ec7aa8e38a93f5b034ac74cebce5de23710317 Mon Sep 17 00:00:00 2001 From: hongbotian Date: Mon, 30 Nov 2015 01:45:08 -0500 Subject: upload http JIRA: BOTTLENECK-10 Change-Id: I7598427ff904df438ce77c2819ee48ac75ffa8da Signed-off-by: hongbotian --- .../srclib/apr/misc/unix/.libs/charset.o | Bin 0 -> 23920 bytes .../httpd-2.0.64/srclib/apr/misc/unix/.libs/env.o | Bin 0 -> 5688 bytes .../srclib/apr/misc/unix/.libs/errorcodes.o | Bin 0 -> 16784 bytes .../srclib/apr/misc/unix/.libs/getopt.o | Bin 0 -> 21456 bytes .../srclib/apr/misc/unix/.libs/otherchild.o | Bin 0 -> 15944 bytes .../httpd-2.0.64/srclib/apr/misc/unix/.libs/rand.o | Bin 0 -> 9368 bytes .../srclib/apr/misc/unix/.libs/start.o | Bin 0 -> 9200 bytes .../srclib/apr/misc/unix/.libs/version.o | Bin 0 -> 3960 bytes .../app/httpd-2.0.64/srclib/apr/misc/unix/Makefile | 16 + .../httpd-2.0.64/srclib/apr/misc/unix/Makefile.in | 16 + .../httpd-2.0.64/srclib/apr/misc/unix/charset.c | 83 +++++ .../httpd-2.0.64/srclib/apr/misc/unix/charset.lo | 12 + .../httpd-2.0.64/srclib/apr/misc/unix/charset.o | Bin 0 -> 23816 bytes rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/env.c | 97 +++++ .../app/httpd-2.0.64/srclib/apr/misc/unix/env.lo | 12 + rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/env.o | Bin 0 -> 5632 bytes .../httpd-2.0.64/srclib/apr/misc/unix/errorcodes.c | 414 +++++++++++++++++++++ .../srclib/apr/misc/unix/errorcodes.lo | 12 + .../httpd-2.0.64/srclib/apr/misc/unix/errorcodes.o | Bin 0 -> 15416 bytes .../app/httpd-2.0.64/srclib/apr/misc/unix/getopt.c | 309 +++++++++++++++ .../httpd-2.0.64/srclib/apr/misc/unix/getopt.lo | 12 + .../app/httpd-2.0.64/srclib/apr/misc/unix/getopt.o | Bin 0 -> 21152 bytes .../httpd-2.0.64/srclib/apr/misc/unix/otherchild.c | 246 ++++++++++++ .../srclib/apr/misc/unix/otherchild.lo | 12 + .../httpd-2.0.64/srclib/apr/misc/unix/otherchild.o | Bin 0 -> 16384 bytes .../app/httpd-2.0.64/srclib/apr/misc/unix/rand.c | 209 +++++++++++ .../app/httpd-2.0.64/srclib/apr/misc/unix/rand.lo | 12 + .../app/httpd-2.0.64/srclib/apr/misc/unix/rand.o | Bin 0 -> 9288 bytes .../app/httpd-2.0.64/srclib/apr/misc/unix/start.c | 89 +++++ .../app/httpd-2.0.64/srclib/apr/misc/unix/start.lo | 12 + .../app/httpd-2.0.64/srclib/apr/misc/unix/start.o | Bin 0 -> 9256 bytes .../httpd-2.0.64/srclib/apr/misc/unix/version.c | 35 ++ .../httpd-2.0.64/srclib/apr/misc/unix/version.lo | 12 + .../httpd-2.0.64/srclib/apr/misc/unix/version.o | Bin 0 -> 3928 bytes 34 files changed, 1610 insertions(+) create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/charset.o create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/env.o create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/errorcodes.o create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/getopt.o create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/otherchild.o create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/rand.o create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/start.o create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/version.o create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/Makefile create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/Makefile.in create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/charset.c create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/charset.lo create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/charset.o create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/env.c create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/env.lo create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/env.o create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/errorcodes.c create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/errorcodes.lo create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/errorcodes.o create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/getopt.c create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/getopt.lo create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/getopt.o create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/otherchild.c create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/otherchild.lo create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/otherchild.o create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/rand.c create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/rand.lo create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/rand.o create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/start.c create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/start.lo create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/start.o create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/version.c create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/version.lo create mode 100644 rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/version.o (limited to 'rubbos/app/httpd-2.0.64/srclib/apr/misc/unix') diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/charset.o b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/charset.o new file mode 100644 index 00000000..10062ca8 Binary files /dev/null and b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/charset.o differ diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/env.o b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/env.o new file mode 100644 index 00000000..c4a911b2 Binary files /dev/null and b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/env.o differ diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/errorcodes.o b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/errorcodes.o new file mode 100644 index 00000000..b859d41d Binary files /dev/null and b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/errorcodes.o differ diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/getopt.o b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/getopt.o new file mode 100644 index 00000000..3ce5cd4f Binary files /dev/null and b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/getopt.o differ diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/otherchild.o b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/otherchild.o new file mode 100644 index 00000000..816cd352 Binary files /dev/null and b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/otherchild.o differ diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/rand.o b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/rand.o new file mode 100644 index 00000000..97f49838 Binary files /dev/null and b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/rand.o differ diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/start.o b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/start.o new file mode 100644 index 00000000..83415657 Binary files /dev/null and b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/start.o differ diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/version.o b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/version.o new file mode 100644 index 00000000..f1272498 Binary files /dev/null and b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/.libs/version.o differ diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/Makefile b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/Makefile new file mode 100644 index 00000000..f25e2120 --- /dev/null +++ b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/Makefile @@ -0,0 +1,16 @@ +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 /bottlenecks/rubbos/app/httpd-2.0.64/srclib/apr/build/apr_rules.mk + +INCDIR=../../include +OSDIR=$(INCDIR)/arch/unix +DEFOSDIR=$(INCDIR)/arch/unix +INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) + +# DO NOT REMOVE diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/Makefile.in b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/Makefile.in new file mode 100644 index 00000000..fffd81c1 --- /dev/null +++ b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/Makefile.in @@ -0,0 +1,16 @@ +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/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/charset.c b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/charset.c new file mode 100644 index 00000000..57018a7c --- /dev/null +++ b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/charset.c @@ -0,0 +1,83 @@ +/* Licensed to the Apache Software 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_private.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(CODESET) + const char *charset; + + charset = nl_langinfo(CODESET); + 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 apr_pstrdup(pool, charset); + } +#endif + + return apr_os_default_encoding(pool); +} diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/charset.lo b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/charset.lo new file mode 100644 index 00000000..d3e19344 --- /dev/null +++ b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/charset.lo @@ -0,0 +1,12 @@ +# charset.lo - a libtool object file +# Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.493 2008/02/01 16:58:18) +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# Name of the PIC object. +pic_object='.libs/charset.o' + +# Name of the non-PIC object. +non_pic_object='charset.o' + diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/charset.o b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/charset.o new file mode 100644 index 00000000..218e464a Binary files /dev/null and b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/charset.o differ diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/env.c b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/env.c new file mode 100644 index 00000000..9ba6b61e --- /dev/null +++ b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/env.c @@ -0,0 +1,97 @@ +/* Licensed to the Apache Software 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. + */ + +#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 + /* 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 +} diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/env.lo b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/env.lo new file mode 100644 index 00000000..7140ef3f --- /dev/null +++ b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/env.lo @@ -0,0 +1,12 @@ +# env.lo - a libtool object file +# Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.493 2008/02/01 16:58:18) +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# Name of the PIC object. +pic_object='.libs/env.o' + +# Name of the non-PIC object. +non_pic_object='env.o' + diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/env.o b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/env.o new file mode 100644 index 00000000..2189927c Binary files /dev/null and b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/env.o differ diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/errorcodes.c b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/errorcodes.c new file mode 100644 index 00000000..ec81ca9d --- /dev/null +++ b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/errorcodes.c @@ -0,0 +1,414 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "apr_arch_misc.h" +#include "apr_strings.h" +#include "apr_lib.h" +#include "apr_dso.h" + +#if APR_HAVE_NETDB_H +#include +#endif +#ifdef HAVE_DLFCN_H +#include +#endif + +/* + * 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, apr_size_t bufsize, const char *s) +{ + apr_cpystrn(buf,s,bufsize); + return buf; +} + +static char *apr_error_string(apr_status_t statcode) +{ + switch (statcode) { + case APR_ENOPOOL: + return "A new pool could not be created."; + 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: +#if APR_HAS_DSO && defined(HAVE_LIBDL) + return dlerror(); +#else + return "DSO load failed"; +#endif /* HAVE_LIBDL */ + 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 " + "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_INCOMPLETE: + return "Partial results are valid but processing is incomplete"; + 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"; + 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"; + case APR_EPATHWILD: + return "The given path contained wildcard characters"; + case APR_EPROC_UNKNOWN: + return "The process is not recognized."; + default: + return "Error string not specified yet"; + } +} + + +#ifdef OS2 +#include + +int apr_canonical_error(apr_status_t err); + +static char *apr_os_strerror(char* buf, apr_size_t bufsize, int err) +{ + char result[200]; + unsigned char message[HUGE_STRING_LEN]; + ULONG len; + char *pos; + int c; + + if (err >= 10000 && err < 12000) { /* socket error codes */ + return stuffbuffer(buf, bufsize, + strerror(apr_canonical_error(err+APR_OS_START_SYSERR))); + } + else if (DosGetMessage(NULL, 0, message, HUGE_STRING_LEN, err, + "OSO001.MSG", &len) == 0) { + len--; + message[len] = 0; + pos = result; + + if (len >= sizeof(result)) + len = sizeof(result-1); + + for (c=0; ccont = cont; + (*os)->reset = 0; + (*os)->errfn = (apr_getopt_err_fn_t*)(fprintf); + (*os)->errarg = (void*)(stderr); + + (*os)->place = EMSG; + (*os)->argc = argc; + + /* 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. */ + 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; + (*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) +{ + const char *oli; /* option letter list index */ + + 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 (os->place[1] && *++os->place == '-') { /* found "--" */ + ++os->ind; + os->place = EMSG; + *optch = os->opt; + return (APR_EOF); + } + } /* option letter okay? */ + 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 (os->opt == (int) '-') { + *optch = os->opt; + return (APR_EOF); + } + if (!*os->place) + ++os->ind; + if (os->errfn && *opts != ':') { + (os->errfn)(os->errarg, "%s: illegal option -- %c\n", + apr_filepath_name_get(*os->argv), os->opt); + } + *optch = os->opt; + return (APR_BADCH); + } + if (*++oli != ':') { /* don't need argument */ + *optarg = NULL; + if (!*os->place) + ++os->ind; + } + else { /* need an argument */ + 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 (os->errfn) { + (os->errfn)(os->errarg, + "%s: option requires an argument -- %c\n", + apr_filepath_name_get(*os->argv), os->opt); + } + *optch = os->opt; + return (APR_BADCH); + } + else /* white space */ + *optarg = os->argv[os->ind]; + os->place = EMSG; + ++os->ind; + } + *optch = os->opt; + return APR_SUCCESS; +} + +/* Reverse the sequence argv[start..start+len-1]. */ +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; + } +} + +/* + * 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; + + 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->errfn) + (os->errfn)(os->errarg, "%s: %s: %s\n", + apr_filepath_name_get(*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->errfn) + (os->errfn)(os->errarg, "%s: %s: %c\n", + apr_filepath_name_get(*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 char *p; + int i; + + /* 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. */ + 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); + + 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; + + 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; ; i++) { + 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; + } else { + *optarg = NULL; + os->place = p; + } + + permute(os); + return APR_SUCCESS; +} diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/getopt.lo b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/getopt.lo new file mode 100644 index 00000000..fffb2aa4 --- /dev/null +++ b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/getopt.lo @@ -0,0 +1,12 @@ +# getopt.lo - a libtool object file +# Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.493 2008/02/01 16:58:18) +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# Name of the PIC object. +pic_object='.libs/getopt.o' + +# Name of the non-PIC object. +non_pic_object='getopt.o' + diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/getopt.o b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/getopt.o new file mode 100644 index 00000000..be33d356 Binary files /dev/null and b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/getopt.o differ diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/otherchild.c b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/otherchild.c new file mode 100644 index 00000000..0ea57739 --- /dev/null +++ b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/otherchild.c @@ -0,0 +1,246 @@ +/* Licensed to the Apache Software 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_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 +#ifdef HAVE_SYS_SELECT_H +#include +#endif +#if APR_HAVE_SYS_WAIT_H +#include +#endif +#ifdef BEOS +#include /* for fd_set definition! */ +#endif + +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 *proc, + void (*maintenance) (int reason, void *, int status), + void *data, apr_file_t *write_fd, apr_pool_t *p) +{ + apr_other_child_rec_t *ocr; + + ocr = apr_palloc(p, sizeof(*ocr)); + ocr->p = p; + 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, + apr_pool_cleanup_null); +} + +APR_DECLARE(void) apr_proc_other_child_unregister(void *data) +{ + apr_other_child_rec_t *cur; + + 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); +} + +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 != proc->pid) + continue; + + ocr->proc = NULL; + (*ocr->maintenance) (reason, ocr->data, status); + return APR_SUCCESS; + } + return APR_EPROC_UNKNOWN; +} + +APR_DECLARE(void) apr_proc_other_child_refresh(apr_other_child_rec_t *ocr, + int reason) +{ + /* Todo: + * Implement code to detect if pipes are still alive. + */ +#ifdef WIN32 + DWORD status; + + if (ocr->proc == NULL) + return; + + if (!ocr->proc->hproc) { + /* 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); + } + 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 */ + pid_t waitret; + int status; + + 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) (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); +} + diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/otherchild.lo b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/otherchild.lo new file mode 100644 index 00000000..3db8e42d --- /dev/null +++ b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/otherchild.lo @@ -0,0 +1,12 @@ +# otherchild.lo - a libtool object file +# Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.493 2008/02/01 16:58:18) +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# Name of the PIC object. +pic_object='.libs/otherchild.o' + +# Name of the non-PIC object. +non_pic_object='otherchild.o' + diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/otherchild.o b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/otherchild.o new file mode 100644 index 00000000..35ea63f9 Binary files /dev/null and b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/otherchild.o differ diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/rand.c b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/rand.c new file mode 100644 index 00000000..843c13fc --- /dev/null +++ b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/rand.c @@ -0,0 +1,209 @@ +/* Licensed to the Apache Software 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. + */ + +#define APR_WANT_MEMFUNC +#include "apr_want.h" +#include "apr_general.h" + +#include "apr_arch_misc.h" +#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 + +#ifndef SHUT_RDWR +#define SHUT_RDWR 2 +#endif + +#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 + + 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; + + rc = read(fd, buf, length); + 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; egdsockname++) { + egd_path_len = strlen(*egdsockname); + + 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, *egdsockname, 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) { + bad_errno = errno; + continue; + } + + /* 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); + } + + if (length > 0) { + /* We must have iterated through the list of sockets, + * and no go. Return the errno. + */ + return bad_errno; + } + +#elif defined(HAVE_TRUERAND) /* use truerand */ + + extern int randbyte(void); /* from the truerand library */ + unsigned int idx; + + /* this will increase the startup time of the server, unfortunately... + * (generating 20 bytes takes about 8 seconds) + */ + for (idx=0; idxmajor = 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/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/version.lo b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/version.lo new file mode 100644 index 00000000..dc9f16e3 --- /dev/null +++ b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/version.lo @@ -0,0 +1,12 @@ +# version.lo - a libtool object file +# Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.493 2008/02/01 16:58:18) +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# Name of the PIC object. +pic_object='.libs/version.o' + +# Name of the non-PIC object. +non_pic_object='version.o' + diff --git a/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/version.o b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/version.o new file mode 100644 index 00000000..bb339315 Binary files /dev/null and b/rubbos/app/httpd-2.0.64/srclib/apr/misc/unix/version.o differ -- cgit 1.2.3-korg