MCPcopy Create free account
hub / github.com/apache/httpd / md_timeperiod_slice_before_end

Function md_timeperiod_slice_before_end

modules/md/md_time.c:286–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284}
285
286md_timeperiod_t md_timeperiod_slice_before_end(const md_timeperiod_t *period,
287 const md_timeslice_t *ts)
288{
289 md_timeperiod_t r;
290 apr_time_t duration = ts->len;
291
292 if (ts->norm > 0) {
293 int percent = (int)(((long)apr_time_sec(ts->len)) * 100L
294 / ((long)apr_time_sec(ts->norm)));
295 apr_time_t plen = md_timeperiod_length(period);
296 if (apr_time_sec(plen) > 100) {
297 duration = apr_time_from_sec(apr_time_sec(plen) * percent / 100);
298 }
299 else {
300 duration = plen * percent / 100;
301 }
302 }
303 r.start = period->end - duration;
304 r.end = period->end;
305 return r;
306}
307
308int md_timeslice_eq(const md_timeslice_t *ts1, const md_timeslice_t *ts2)
309{

Callers 6

ostat_should_renewFunction · 0.85
ostat_setFunction · 0.85
mk_jstatFunction · 0.85
md_reg_renew_atFunction · 0.85
md_reg_should_warnFunction · 0.85

Calls 1

md_timeperiod_lengthFunction · 0.85

Tested by

no test coverage detected