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

Function print_job_summary

modules/md/mod_md_status.c:424–518  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

422}
423
424static void print_job_summary(status_ctx *ctx, md_json_t *mdj, const char *key,
425 const char *separator)
426{
427 apr_bucket_brigade *bb = ctx->bb;
428 char buffer[HUGE_STRING_LEN];
429 apr_status_t rv;
430 int finished, errors, cert_count;
431 apr_time_t t;
432 const char *s, *line;
433
434 if (!md_json_has_key(mdj, key, NULL)) {
435 return;
436 }
437
438 finished = md_json_getb(mdj, key, MD_KEY_FINISHED, NULL);
439 errors = (int)md_json_getl(mdj, key, MD_KEY_ERRORS, NULL);
440 rv = (apr_status_t)md_json_getl(mdj, key, MD_KEY_LAST, MD_KEY_STATUS, NULL);
441
442 line = separator? separator : "";
443
444 if (rv != APR_SUCCESS) {
445 char *errstr = apr_strerror(rv, buffer, sizeof(buffer));
446 s = md_json_gets(mdj, key, MD_KEY_LAST, MD_KEY_PROBLEM, NULL);
447 if (HTML_STATUS(ctx)) {
448 line = apr_psprintf(bb->p, "%s Error[%s]: %s", line,
449 errstr, s? s : "");
450 }
451 else {
452 apr_brigade_printf(bb, NULL, NULL, "%sLastStatus: %s\n", ctx->prefix, errstr);
453 apr_brigade_printf(bb, NULL, NULL, "%sLastProblem: %s\n", ctx->prefix, s);
454 }
455 }
456
457 if (!HTML_STATUS(ctx)) {
458 apr_brigade_printf(bb, NULL, NULL, "%sFinished: %s\n", ctx->prefix,
459 finished ? "yes" : "no");
460 }
461 if (finished) {
462 cert_count = 0;
463 md_json_iterkey(count_certs, &cert_count, mdj, key, MD_KEY_CERT, NULL);
464 if (HTML_STATUS(ctx)) {
465 if (cert_count > 0) {
466 line =apr_psprintf(bb->p, "%s finished, %d new certificate%s staged.",
467 line, cert_count, cert_count > 1? "s" : "");
468 }
469 else {
470 line = apr_psprintf(bb->p, "%s finished successfully.", line);
471 }
472 }
473 else {
474 apr_brigade_printf(bb, NULL, NULL, "%sNewStaged: %d\n", ctx->prefix, cert_count);
475 }
476 }
477 else {
478 s = md_json_gets(mdj, key, MD_KEY_LAST, MD_KEY_DETAIL, NULL);
479 if (s) {
480 if (HTML_STATUS(ctx)) {
481 line = apr_psprintf(bb->p, "%s %s", line, s);

Callers 2

si_val_activityFunction · 0.85
si_val_ocsp_activityFunction · 0.85

Calls 7

md_json_has_keyFunction · 0.85
md_json_getbFunction · 0.85
md_json_getlFunction · 0.85
md_json_getsFunction · 0.85
md_json_iterkeyFunction · 0.85
md_json_get_timeFunction · 0.85
print_timeFunction · 0.85

Tested by

no test coverage detected