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

Function md_json_writep

modules/md/md_json.c:992–1013  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

990}
991
992const char *md_json_writep(const md_json_t *json, apr_pool_t *p, md_json_fmt_t fmt)
993{
994 apr_array_header_t *chunks;
995 int rv;
996
997 chunks = apr_array_make(p, 10, sizeof(char *));
998 rv = json_dump_callback(json->j, chunk_cb, chunks, fmt_to_flags(fmt));
999 if (APR_SUCCESS != rv) {
1000 md_log_perror(MD_LOG_MARK, MD_LOG_ERR, 0, p,
1001 "md_json_writep failed to dump JSON");
1002 return NULL;
1003 }
1004
1005 switch (chunks->nelts) {
1006 case 0:
1007 return "";
1008 case 1:
1009 return APR_ARRAY_IDX(chunks, 0, const char*);
1010 default:
1011 return apr_array_pstrcat(p, chunks, 0);
1012 }
1013}
1014
1015apr_status_t md_json_writef(const md_json_t *json, apr_pool_t *p, md_json_fmt_t fmt, apr_file_t *f)
1016{

Callers 12

md_http_cert_statusFunction · 0.85
md_jws_signFunction · 0.85
md_jws_hmacFunction · 0.85
md_json_writefFunction · 0.85
acct_updFunction · 0.85
get_eabFunction · 0.85
md_acme_authz_updateFunction · 0.85
md_result_logFunction · 0.85
acmev2_req_initFunction · 0.85
on_responseFunction · 0.85
md_acme_req_sendFunction · 0.85
update_directoryFunction · 0.85

Calls 2

fmt_to_flagsFunction · 0.85
md_log_perrorFunction · 0.85

Tested by

no test coverage detected