You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by rb...@apache.org on 2001/02/16 01:40:01 UTC
cvs commit: apr/include apr_time.h
rbb 01/02/15 16:40:01
Modified: modules/generators mod_status.c
modules/metadata mod_unique_id.c
include apr_time.h
Log:
Add an apr_short_interval_time. This allows us to use an apr_interval_time
for apr_time_t - apr_time_t values.
Revision Changes Path
1.29 +5 -5 httpd-2.0/modules/generators/mod_status.c
Index: mod_status.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/generators/mod_status.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -b -w -u -r1.28 -r1.29
--- mod_status.c 2001/02/15 19:22:02 1.28
+++ mod_status.c 2001/02/16 00:39:59 1.29
@@ -184,7 +184,7 @@
static void show_time(request_rec *r, apr_interval_time_t tsecs)
{
- apr_time_t days, hrs, mins, secs;
+ int days, hrs, mins, secs;
secs = tsecs % 60;
tsecs /= 60;
@@ -193,13 +193,13 @@
hrs = tsecs % 24;
days = tsecs / 24;
if (days)
- ap_rprintf(r, " %qd day%s", days, days == 1 ? "" : "s");
+ ap_rprintf(r, " %d day%s", days, days == 1 ? "" : "s");
if (hrs)
- ap_rprintf(r, " %qd hour%s", hrs, hrs == 1 ? "" : "s");
+ ap_rprintf(r, " %d hour%s", hrs, hrs == 1 ? "" : "s");
if (mins)
- ap_rprintf(r, " %qd minute%s", mins, mins == 1 ? "" : "s");
+ ap_rprintf(r, " %d minute%s", mins, mins == 1 ? "" : "s");
if (secs)
- ap_rprintf(r, " %qd second%s", secs, secs == 1 ? "" : "s");
+ ap_rprintf(r, " %d second%s", secs, secs == 1 ? "" : "s");
}
/* Main handler for x-httpd-status requests */
1.27 +2 -2 httpd-2.0/modules/metadata/mod_unique_id.c
Index: mod_unique_id.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/metadata/mod_unique_id.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -b -w -u -r1.26 -r1.27
--- mod_unique_id.c 2001/02/10 22:21:23 1.26
+++ mod_unique_id.c 2001/02/16 00:40:00 1.27
@@ -182,7 +182,7 @@
#endif
char str[MAXHOSTNAMELEN + 1];
struct hostent *hent;
- apr_interval_time_t pause;
+ apr_short_interval_time_t pause;
/*
* Calculate the sizes and offsets in cur_unique_id.
@@ -243,7 +243,7 @@
* But protecting against it is relatively cheap. We just sleep into the
* next second.
*/
- pause = (apr_interval_time_t)(1000000 - (apr_time_now() % APR_USEC_PER_SEC));
+ pause = (apr_short_interval_time_t)(1000000 - (apr_time_now() % APR_USEC_PER_SEC));
apr_sleep(pause);
}
1.32 +2 -1 apr/include/apr_time.h
Index: apr_time.h
===================================================================
RCS file: /home/cvs/apr/include/apr_time.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -b -w -u -r1.31 -r1.32
--- apr_time.h 2001/02/08 07:44:47 1.31
+++ apr_time.h 2001/02/16 00:40:01 1.32
@@ -74,7 +74,8 @@
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)
RE: cvs commit: apr/include apr_time.h
Posted by Cliff Woolley <cl...@yahoo.com>.
--- Greg Stein [mailto:gstein@lyra.org] wrote:
> > static void show_time(request_rec *r, apr_interval_time_t tsecs)
>
> apr_interval_time_t is in microseconds, not seconds. This is still an
> inappropriate type here (semantics-wise). OtherBill will be upset :-)
>
> Using an apr_uint32_t, like FirstBill had, was a good choice.
This commit missed the step of moving the conversion from microseconds to
seconds into show_time() (ie, tsecs SHOULD be in microseconds). Make that
change, and the usage of the type should be consistent.
Or use an apr_uint32_t. I'm guessing the hesitation with using that was
that it's a meaningless type... hell, whatever works.
--Cliff
Re: cvs commit: apr/include apr_time.h
Posted by Greg Stein <gs...@lyra.org>.
On Fri, Feb 16, 2001 at 12:40:01AM -0000, rbb@apache.org wrote:
>...
> --- mod_status.c 2001/02/15 19:22:02 1.28
> +++ mod_status.c 2001/02/16 00:39:59 1.29
> @@ -184,7 +184,7 @@
>
> static void show_time(request_rec *r, apr_interval_time_t tsecs)
apr_interval_time_t is in microseconds, not seconds. This is still an
inappropriate type here (semantics-wise). OtherBill will be upset :-)
Using an apr_uint32_t, like FirstBill had, was a good choice.
>...
> --- mod_unique_id.c 2001/02/10 22:21:23 1.26
> +++ mod_unique_id.c 2001/02/16 00:40:00 1.27
> @@ -182,7 +182,7 @@
> #endif
> char str[MAXHOSTNAMELEN + 1];
> struct hostent *hent;
> - apr_interval_time_t pause;
> + apr_short_interval_time_t pause;
>
> /*
> * Calculate the sizes and offsets in cur_unique_id.
> @@ -243,7 +243,7 @@
> * But protecting against it is relatively cheap. We just sleep into the
> * next second.
> */
> - pause = (apr_interval_time_t)(1000000 - (apr_time_now() % APR_USEC_PER_SEC));
> + pause = (apr_short_interval_time_t)(1000000 - (apr_time_now() % APR_USEC_PER_SEC));
> apr_sleep(pause);
What is this change for?
apr_sleep() takes an apr_interval_time_t, so switching this to a short
interval isn't quite right.
Cheers,
-g
--
Greg Stein, http://www.lyra.org/