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

Function si_val_valid_time

modules/md/mod_md_status.c:298–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296}
297
298static void si_val_valid_time(status_ctx *ctx, md_json_t *mdj, const status_info *info)
299{
300 const char *sfrom, *suntil, *sep, *title;
301 apr_time_t from, until;
302
303 sep = NULL;
304 sfrom = md_json_gets(mdj, info->key, MD_KEY_FROM, NULL);
305 from = sfrom? apr_date_parse_rfc(sfrom) : 0;
306 suntil = md_json_gets(mdj, info->key, MD_KEY_UNTIL, NULL);
307 until = suntil?apr_date_parse_rfc(suntil) : 0;
308
309 if (HTML_STATUS(ctx)) {
310 if (from > apr_time_now()) {
311 apr_brigade_puts(ctx->bb, NULL, NULL, "from ");
312 print_date(ctx, from, sfrom);
313 sep = " ";
314 }
315 if (until) {
316 if (sep) apr_brigade_puts(ctx->bb, NULL, NULL, sep);
317 apr_brigade_puts(ctx->bb, NULL, NULL, "until ");
318 title = sfrom? apr_psprintf(ctx->p, "%s - %s", sfrom, suntil) : suntil;
319 print_date(ctx, until, title);
320 }
321 }
322 else {
323 if (from > apr_time_now()) {
324 print_date(ctx, from,
325 apr_pstrcat(ctx->p, info->label, "From", NULL));
326 }
327 if (until) {
328 print_date(ctx, until,
329 apr_pstrcat(ctx->p, info->label, "Until", NULL));
330 }
331 }
332}
333
334static void si_add_header(status_ctx *ctx, const status_info *info)
335{

Callers 1

si_val_cert_valid_timeFunction · 0.85

Calls 2

md_json_getsFunction · 0.85
print_dateFunction · 0.85

Tested by

no test coverage detected