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

Function md_json_readf

modules/md/md_json.c:1156–1180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1154}
1155
1156apr_status_t md_json_readf(md_json_t **pjson, apr_pool_t *p, const char *fpath)
1157{
1158 apr_file_t *f;
1159 json_t *j;
1160 apr_status_t rv;
1161 json_error_t error;
1162
1163 rv = apr_file_open(&f, fpath, APR_FOPEN_READ, 0, p);
1164 if (rv != APR_SUCCESS) {
1165 return rv;
1166 }
1167
1168 j = json_load_callback(load_file_cb, f, 0, &error);
1169 if (j) {
1170 *pjson = json_create(p, j);
1171 }
1172 else {
1173 md_log_perror(MD_LOG_MARK, MD_LOG_ERR, 0, p,
1174 "failed to load JSON file %s: %s (line %d:%d)",
1175 fpath, error.text, error.line, error.column);
1176 }
1177
1178 apr_file_close(f);
1179 return (j && *pjson) ? APR_SUCCESS : APR_EINVAL;
1180}
1181
1182/**************************************************************************************************/
1183/* http get */

Callers 3

md_config_set_eabFunction · 0.85
read_store_fileFunction · 0.85
fs_floadFunction · 0.85

Calls 2

json_createFunction · 0.85
md_log_perrorFunction · 0.85

Tested by

no test coverage detected