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

Function si_val_status

modules/md/mod_md_status.c:172–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170};
171
172static void si_val_status(status_ctx *ctx, md_json_t *mdj, const status_info *info)
173{
174 const char *s = "unknown";
175 apr_time_t until;
176 (void)info;
177 switch (md_json_getl(mdj, info->key, NULL)) {
178 case MD_S_INCOMPLETE:
179 s = md_json_gets(mdj, MD_KEY_STATE_DESCR, NULL);
180 s = s? apr_psprintf(ctx->p, "incomplete: %s", s) : "incomplete";
181 break;
182 case MD_S_EXPIRED_DEPRECATED:
183 case MD_S_COMPLETE:
184 until = md_json_get_time(mdj, MD_KEY_CERT, MD_KEY_VALID, MD_KEY_UNTIL, NULL);
185 s = (!until || until > apr_time_now())? "good" : "expired";
186 break;
187 case MD_S_ERROR: s = "error"; break;
188 case MD_S_MISSING_INFORMATION: s = "missing information"; break;
189 default: break;
190 }
191 if (HTML_STATUS(ctx)) {
192 apr_brigade_puts(ctx->bb, NULL, NULL, s);
193 }
194 else {
195 apr_brigade_printf(ctx->bb, NULL, NULL, "%s%s: %s\n",
196 ctx->prefix, info->label, s);
197 }
198}
199
200static void si_val_url(status_ctx *ctx, md_json_t *mdj, const status_info *info)
201{

Callers

nothing calls this directly

Calls 3

md_json_getlFunction · 0.85
md_json_getsFunction · 0.85
md_json_get_timeFunction · 0.85

Tested by

no test coverage detected