cvs: /php4 php_reentrancy.h reentrancy.c /php4 Makefile.am configure.in php.h php_globals.h /php4/sapi/aolserver aolserver.c
| From: | Sascha Schumann | Date: | Fri, 26 Nov 1999 17:07:43 +0000 |
| Subject: | cvs: /php4 php_reentrancy.h reentrancy.c /php4 Makefile.am configure.in php.h php_globals.h /php4/sapi/aolserver aolserver.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-6936@lists.php.net to get a copy of this message | ||
sas Fri Nov 26 12:07:43 1999 EDT
Added files:
/php4 php_reentrancy.h reentrancy.c
Modified files:
/php4 Makefile.am configure.in php.h php_globals.h
/php4/sapi/aolserver aolserver.c
Log:
Add reentrant versions of ctime, localtime, gmtime, asctime.
These cannot be implemented platform-independent, so we fall back to the native
non-reentrant versions, but lock during each access (only if ZTS is used).
To initialize/destroy the used data structures, you need to call
reentrancy_startup() before sapi_startup(), and reentrancy_shutdown() after
sapi_shutdown().
Index: php4/Makefile.am
diff -u php4/Makefile.am:1.13 php4/Makefile.am:1.14
--- php4/Makefile.am:1.13 Mon Nov 22 06:00:52 1999
+++ php4/Makefile.am Fri Nov 26 12:07:41 1999
@@ -11,7 +11,7 @@
configuration-parser.y configuration-scanner.l request_info.c \
safe_mode.c fopen-wrappers.c php3_realpath.c alloca.c \
php_ini.c SAPI.c rfc1867.c dlist.c php_content_types.c strlcpy.c \
- strlcat.c mergesort.c
+ strlcat.c mergesort.c strtok_r.c reentrancy.c
libphp4_la_DEPENDENCIES = \
libzend/libzend.la \
Index: php4/configure.in
diff -u php4/configure.in:1.40 php4/configure.in:1.41
--- php4/configure.in:1.40 Fri Nov 26 08:34:02 1999
+++ php4/configure.in Fri Nov 26 12:07:41 1999
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.40 1999/11/26 13:34:02 sas Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.41 1999/11/26 17:07:41 sas Exp $ -*- sh -*-
dnl ## Process this file with autoconf to produce a configure script.
divert(0)
@@ -292,15 +292,19 @@
dnl Checks for library functions.
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(
+asctime_r \
crypt \
+ctime_r \
cuserid \
flock \
gcvt \
getlogin \
gethostbyaddr \
gettimeofday \
+gmtime_r \
inet_aton \
link \
+localtime_r \
lockf \
lrand48 \
memcpy \
Index: php4/php.h
diff -u php4/php.h:1.45 php4/php.h:1.46
--- php4/php.h:1.45 Wed Nov 17 17:58:29 1999
+++ php4/php.h Fri Nov 26 12:07:41 1999
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php.h,v 1.45 1999/11/17 22:58:29 sas Exp $ */
+/* $Id: php.h,v 1.46 1999/11/26 17:07:41 sas Exp $ */
#ifndef _PHP_H
#define _PHP_H
@@ -343,6 +343,7 @@
#define PHP_CONNECTION_ABORTED 1
#define PHP_CONNECTION_TIMEOUT 2
+#include "php_reentrancy.h"
/* Finding offsets of elements within structures.
* Taken from the Apache code, which in turn, was taken from X code...
Index: php4/php_globals.h
diff -u php4/php_globals.h:1.25 php4/php_globals.h:1.26
--- php4/php_globals.h:1.25 Wed Nov 17 18:01:27 1999
+++ php4/php_globals.h Fri Nov 26 12:07:41 1999
@@ -72,6 +72,8 @@
char *upload_tmp_dir;
long upload_max_filesize;
+
+ char *current_dir;
char *auto_prepend_file;
char *auto_append_file;
Index: php4/sapi/aolserver/aolserver.c
diff -u php4/sapi/aolserver/aolserver.c:1.15 php4/sapi/aolserver/aolserver.c:1.16
--- php4/sapi/aolserver/aolserver.c:1.15 Wed Nov 24 12:36:23 1999
+++ php4/sapi/aolserver/aolserver.c Fri Nov 26 12:07:41 1999
@@ -22,7 +22,7 @@
* - CGI/1.1 conformance
*/
-/* $Id: aolserver.c,v 1.15 1999/11/24 17:36:23 sas Exp $ */
+/* $Id: aolserver.c,v 1.16 1999/11/26 17:07:41 sas Exp $ */
/* conflict between PHP and AOLserver headers */
#define Debug php_Debug
@@ -196,7 +196,7 @@
int uptime = Ns_InfoUptime();
PUTS("<table border=5 width=600>\n");
- php_info_print_table_row(2, "SAPI module version", "$Id: aolserver.c,v 1.15
1999/11/24 17:36:23 sas Exp $");
+ php_info_print_table_row(2, "SAPI module version", "$Id: aolserver.c,v 1.16
1999/11/26 17:07:41 sas Exp $");
php_info_print_table_row(2, "Build date", Ns_InfoBuildDate());
php_info_print_table_row(2, "Config file path", Ns_InfoConfigFile());
php_info_print_table_row(2, "Error Log path", Ns_InfoErrorLog());
@@ -288,6 +288,7 @@
* with a number of variables. HTTP_* variables are created for
* the HTTP header data, so that a script can access these.
*/
+
#define ADD_STRING(name) \
MAKE_STD_ZVAL(pval); \
pval->type = IS_STRING; \
@@ -541,6 +542,7 @@
ctx->sapi_module->shutdown(ctx->sapi_module);
sapi_shutdown();
+ reentrancy_shutdown();
tsrm_shutdown();
free(ctx->ns_module);
@@ -560,6 +562,7 @@
php_ns_context *ctx;
tsrm_startup(1, 1, 0);
+ reentrancy_startup();
sapi_startup(&sapi_module);
sapi_module.startup(&sapi_module);