httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niklas Edmundsson <ni...@acc.umu.se>
Subject mod_cache: Broken code?
Date Fri, 24 Apr 2015 06:04:20 GMT

When trying to debug something else I stumbled across this 
code-snippet in modules/cache/mod_cache.c:

errno = 0;
x = control.max_age_value;
if (errno) {
     x = dconf->defex;
}
else {
     x = x * MSEC_ONE_SEC;
}

It looks that way both in trunk and 2.4.x.

The likelhood of that if-statement to have more than one outcome is 
low, and the fact that errno isn't used anywhere else in mod_cache.c 
makes it even more suspicious.

Looking at the annotated history it seems like the errno-stuff stems 
from apr_atoi64() being used once upon a time but has since been 
removed without cleaning up the related code...

It's easy to just remove the now redundant code, but is that the right 
way to do it or did the initial code have some function that's now 
gone missing?


/Nikke
-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Niklas Edmundsson, Admin @ {acc,hpc2n}.umu.se      |     nikke@acc.umu.se
---------------------------------------------------------------------------
  Those who can, do.  Those who can't, simulate.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Mime
View raw message