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

Function md_json_set_timeperiod

modules/md/md_json.c:1263–1293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1261}
1262
1263apr_status_t md_json_set_timeperiod(const md_timeperiod_t *tp, md_json_t *json, ...)
1264{
1265 char ts[APR_RFC822_DATE_LEN];
1266 json_t *jn, *j;
1267 va_list ap;
1268 const char *key;
1269 apr_status_t rv;
1270
1271 if (tp && tp->start && tp->end) {
1272 jn = json_object();
1273 apr_rfc822_date(ts, tp->start);
1274 json_object_set_new(jn, "from", json_string(ts));
1275 apr_rfc822_date(ts, tp->end);
1276 json_object_set_new(jn, "until", json_string(ts));
1277
1278 va_start(ap, json);
1279 rv = jselect_set_new(jn, json, ap);
1280 va_end(ap);
1281 return rv;
1282 }
1283 else {
1284 va_start(ap, json);
1285 j = jselect_parent(&key, 0, json, ap);
1286 va_end(ap);
1287
1288 if (key && j && json_is_object(j)) {
1289 json_object_del(j, key);
1290 }
1291 return APR_SUCCESS;
1292 }
1293}
1294
1295apr_status_t md_json_get_timeperiod(md_timeperiod_t *tp, md_json_t *json, ...)
1296{

Callers 5

ostat_to_jsonFunction · 0.85
mk_jstatFunction · 0.85
md_status.cFile · 0.85
status_get_cert_json_exFunction · 0.85
status_get_certs_jsonFunction · 0.85

Calls 2

jselect_set_newFunction · 0.85
jselect_parentFunction · 0.85

Tested by

no test coverage detected