httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject [PATCH] Allow mod_cache to be build/loaded as DSO
Date Tue, 07 Sep 2004 13:10:45 GMT
I've noticed that if you build httpd normally (with DSO capability)
and then use apxs to try to build mod_cache, then when you try
to run the server you get:

   mod_cache.so: symbol __floatdidf: referenced symbol not found

This is due to the fact that the required math functions to do some
date calcs aren't available since when httpd was initially built,
there was no need. It also means there are some dependencies
issues which might be best to be avoided (libgcc for example).

Anyway, this patch gets around it by breaking the calculations
into separate steps, keeping the result within normal bounds.

Index: modules/experimental/mod_cache.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_cache.c,v
retrieving revision 1.89
diff -u -r1.89 mod_cache.c
--- modules/experimental/mod_cache.c	17 Aug 2004 16:34:51 -0000	1.89
+++ modules/experimental/mod_cache.c	7 Sep 2004 13:05:17 -0000
@@ -683,7 +683,14 @@
          *   freshness calculations, so we choose the else path...
          */
         if ((lastmod != APR_DATE_BAD) && (lastmod < date)) {
-            apr_time_t x = (apr_time_t) ((date - lastmod) * conf->factor);
+            apr_time_t x;
+            long diff;
+            diff = (date - lastmod);
+            diff = diff * conf->factor;
+            x = diff;
+            /*
+             apr_time_t x = (apr_time_t) ((date - lastmod) * conf->factor);
+            */
 
             if (x > conf->maxex) {
                 x = conf->maxex;

Mime
View raw message