jorton Sat Oct 23 09:48:05 2004 EDT
Modified files:
/php-src/sapi/apache2filter sapi_apache2.c php_functions.c
/php-src/sapi/apache2handler php_functions.c sapi_apache2.c
Log:
- always convert apr_time_t to time_t using apr_time_sec() to be future-proof.
- print apr_time_t values using APR_TIME_T and apr_snprintf.
- remove redundant add_property_long calls.
http://cvs.php.net/diff.php/php-src/sapi/apache2filter/sapi_apache2.c?r1=1.130&r2=1.131&ty=u
Index: php-src/sapi/apache2filter/sapi_apache2.c
diff -u php-src/sapi/apache2filter/sapi_apache2.c:1.130
php-src/sapi/apache2filter/sapi_apache2.c:1.131
--- php-src/sapi/apache2filter/sapi_apache2.c:1.130 Sat Oct 23 08:56:20 2004
+++ php-src/sapi/apache2filter/sapi_apache2.c Sat Oct 23 09:48:04 2004
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sapi_apache2.c,v 1.130 2004/10/23 12:56:20 jorton Exp $ */
+/* $Id: sapi_apache2.c,v 1.131 2004/10/23 13:48:04 jorton Exp $ */
#include <fcntl.h>
@@ -174,13 +174,13 @@
ctx->finfo.st_dev = ctx->r->finfo.device;
ctx->finfo.st_ino = ctx->r->finfo.inode;
#ifdef NETWARE
- ctx->finfo.st_atime.tv_sec = ctx->r->finfo.atime/1000000;
- ctx->finfo.st_mtime.tv_sec = ctx->r->finfo.mtime/1000000;
- ctx->finfo.st_ctime.tv_sec = ctx->r->finfo.ctime/1000000;
+ ctx->finfo.st_atime.tv_sec = apr_time_sec(ctx->r->finfo.atime);
+ ctx->finfo.st_mtime.tv_sec = apr_time_sec(ctx->r->finfo.mtime);
+ ctx->finfo.st_ctime.tv_sec = apr_time_sec(ctx->r->finfo.ctime);
#else
- ctx->finfo.st_atime = ctx->r->finfo.atime/1000000;
- ctx->finfo.st_mtime = ctx->r->finfo.mtime/1000000;
- ctx->finfo.st_ctime = ctx->r->finfo.ctime/1000000;
+ ctx->finfo.st_atime = apr_time_sec(ctx->r->finfo.atime);
+ ctx->finfo.st_mtime = apr_time_sec(ctx->r->finfo.mtime);
+ ctx->finfo.st_ctime = apr_time_sec(ctx->r->finfo.ctime);
#endif
ctx->finfo.st_size = ctx->r->finfo.size;
http://cvs.php.net/diff.php/php-src/sapi/apache2filter/php_functions.c?r1=1.42&r2=1.43&ty=u
Index: php-src/sapi/apache2filter/php_functions.c
diff -u php-src/sapi/apache2filter/php_functions.c:1.42
php-src/sapi/apache2filter/php_functions.c:1.43
--- php-src/sapi/apache2filter/php_functions.c:1.42 Mon Jul 19 03:19:49 2004
+++ php-src/sapi/apache2filter/php_functions.c Sat Oct 23 09:48:04 2004
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_functions.c,v 1.42 2004/07/19 07:19:49 andi Exp $ */
+/* $Id: php_functions.c,v 1.43 2004/10/23 13:48:04 jorton Exp $ */
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
@@ -92,7 +92,7 @@
#define ADD_LONG(name) \
add_property_long(return_value, #name, rr->name)
#define ADD_TIME(name) \
- add_property_long(return_value, #name, rr->name / APR_USEC_PER_SEC);
+ add_property_long(return_value, #name, apr_time_sec(rr->name));
#define ADD_STRING(name) \
if (rr->name) add_property_string(return_value, #name, (char *)
rr->name, 1)
@@ -138,7 +138,6 @@
ADD_LONG(allowed);
ADD_LONG(sent_bodyct);
ADD_LONG(bytes_sent);
- ADD_LONG(request_time);
ADD_LONG(mtime);
ADD_TIME(request_time);
http://cvs.php.net/diff.php/php-src/sapi/apache2handler/php_functions.c?r1=1.14&r2=1.15&ty=u
Index: php-src/sapi/apache2handler/php_functions.c
diff -u php-src/sapi/apache2handler/php_functions.c:1.14
php-src/sapi/apache2handler/php_functions.c:1.15
--- php-src/sapi/apache2handler/php_functions.c:1.14 Mon Jul 19 03:19:50 2004
+++ php-src/sapi/apache2handler/php_functions.c Sat Oct 23 09:48:05 2004
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_functions.c,v 1.14 2004/07/19 07:19:50 andi Exp $ */
+/* $Id: php_functions.c,v 1.15 2004/10/23 13:48:05 jorton Exp $ */
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
@@ -110,7 +110,7 @@
#define ADD_LONG(name) \
add_property_long(return_value, #name, rr->name)
#define ADD_TIME(name) \
- add_property_long(return_value, #name, rr->name / APR_USEC_PER_SEC);
+ add_property_long(return_value, #name, apr_time_sec(rr->name));
#define ADD_STRING(name) \
if (rr->name) add_property_string(return_value, #name, (char *)
rr->name, 1)
@@ -156,7 +156,6 @@
ADD_LONG(allowed);
ADD_LONG(sent_bodyct);
ADD_LONG(bytes_sent);
- ADD_LONG(request_time);
ADD_LONG(mtime);
ADD_TIME(request_time);
@@ -402,7 +401,9 @@
sprintf(tmp, "Per Child: %d - Keep Alive: %s - Max Per Connection: %d",
max_requests, (serv->keep_alive ? "on":"off"), serv->keep_alive_max);
php_info_print_table_row(2, "Max Requests", tmp);
- sprintf(tmp, "Connection: %lld - Keep-Alive: %lld", (serv->timeout / 1000000),
(serv->keep_alive_timeout / 1000000));
+ apr_snprintf(tmp, sizeof tmp,
+ "Connection: %" APR_TIME_T_FMT " - Keep-Alive: %"
APR_TIME_T_FMT,
+ apr_time_sec(serv->timeout),
apr_time_sec(serv->keep_alive_timeout));
php_info_print_table_row(2, "Timeouts", tmp);
php_info_print_table_row(2, "Virtual Server", (serv->is_virtual ? "Yes" :
"No"));
http://cvs.php.net/diff.php/php-src/sapi/apache2handler/sapi_apache2.c?r1=1.46&r2=1.47&ty=u
Index: php-src/sapi/apache2handler/sapi_apache2.c
diff -u php-src/sapi/apache2handler/sapi_apache2.c:1.46
php-src/sapi/apache2handler/sapi_apache2.c:1.47
--- php-src/sapi/apache2handler/sapi_apache2.c:1.46 Sat Oct 23 08:56:19 2004
+++ php-src/sapi/apache2handler/sapi_apache2.c Sat Oct 23 09:48:05 2004
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sapi_apache2.c,v 1.46 2004/10/23 12:56:19 jorton Exp $ */
+/* $Id: sapi_apache2.c,v 1.47 2004/10/23 13:48:05 jorton Exp $ */
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
@@ -169,13 +169,13 @@
ctx->finfo.st_dev = ctx->r->finfo.device;
ctx->finfo.st_ino = ctx->r->finfo.inode;
#if defined(NETWARE) && defined(CLIB_STAT_PATCH)
- ctx->finfo.st_atime.tv_sec = ctx->r->finfo.atime/1000000;
- ctx->finfo.st_mtime.tv_sec = ctx->r->finfo.mtime/1000000;
- ctx->finfo.st_ctime.tv_sec = ctx->r->finfo.ctime/1000000;
+ ctx->finfo.st_atime.tv_sec = apr_time_sec(ctx->r->finfo.atime);
+ ctx->finfo.st_mtime.tv_sec = apr_time_sec(ctx->r->finfo.mtime);
+ ctx->finfo.st_ctime.tv_sec = apr_time_sec(ctx->r->finfo.ctime);
#else
- ctx->finfo.st_atime = ctx->r->finfo.atime/1000000;
- ctx->finfo.st_mtime = ctx->r->finfo.mtime/1000000;
- ctx->finfo.st_ctime = ctx->r->finfo.ctime/1000000;
+ ctx->finfo.st_atime = apr_time_sec(ctx->r->finfo.atime);
+ ctx->finfo.st_mtime = apr_time_sec(ctx->r->finfo.mtime);
+ ctx->finfo.st_ctime = apr_time_sec(ctx->r->finfo.ctime);
#endif
ctx->finfo.st_size = ctx->r->finfo.size;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php