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

Function md_result_to_json

modules/md/md_result.c:160–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160struct md_json_t *md_result_to_json(const md_result_t *result, apr_pool_t *p)
161{
162 md_json_t *json;
163 char ts[APR_RFC822_DATE_LEN];
164
165 json = md_json_create(p);
166 md_json_setl(result->status, json, MD_KEY_STATUS, NULL);
167 if (result->status > 0) {
168 char buffer[HUGE_STRING_LEN];
169 apr_strerror(result->status, buffer, sizeof(buffer));
170 md_json_sets(buffer, json, "status-description", NULL);
171 }
172 if (result->problem) md_json_sets(result->problem, json, MD_KEY_PROBLEM, NULL);
173 if (result->detail) md_json_sets(result->detail, json, MD_KEY_DETAIL, NULL);
174 if (result->activity) md_json_sets(result->activity, json, MD_KEY_ACTIVITY, NULL);
175 if (result->ready_at > 0) {
176 apr_rfc822_date(ts, result->ready_at);
177 md_json_sets(ts, json, MD_KEY_VALID_FROM, NULL);
178 }
179 if (result->subproblems) {
180 md_json_setj(result->subproblems, json, MD_KEY_SUBPROBLEMS, NULL);
181 }
182 return json;
183}
184
185static int str_cmp(const char *s1, const char *s2)
186{

Callers 1

job_to_jsonFunction · 0.85

Calls 4

md_json_createFunction · 0.85
md_json_setlFunction · 0.85
md_json_setsFunction · 0.85
md_json_setjFunction · 0.85

Tested by

no test coverage detected