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

Function p_md_update

modules/md/md_reg.c:453–551  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

451}
452
453static apr_status_t p_md_update(void *baton, apr_pool_t *p, apr_pool_t *ptemp, va_list ap)
454{
455 md_reg_t *reg = baton;
456 apr_status_t rv = APR_SUCCESS;
457 const char *name;
458 const md_t *md, *updates;
459 int fields, do_checks;
460 md_t *nmd;
461
462 name = va_arg(ap, const char *);
463 updates = va_arg(ap, const md_t *);
464 fields = va_arg(ap, int);
465 do_checks = va_arg(ap, int);
466
467 if (NULL == (md = md_reg_get(reg, name, ptemp))) {
468 md_log_perror(MD_LOG_MARK, MD_LOG_DEBUG, APR_ENOENT, ptemp, "md %s", name);
469 return APR_ENOENT;
470 }
471
472 md_log_perror(MD_LOG_MARK, MD_LOG_DEBUG, 0, ptemp, "md[%s]: update store", name);
473
474 if (do_checks && APR_SUCCESS != (rv = check_values(reg, ptemp, updates, fields))) {
475 return rv;
476 }
477
478 if (reg->domains_frozen) return APR_EACCES;
479 nmd = md_copy(ptemp, md);
480 if (MD_UPD_DOMAINS & fields) {
481 nmd->domains = updates->domains;
482 md_log_perror(MD_LOG_MARK, MD_LOG_TRACE1, 0, ptemp, "update domains: %s", name);
483 }
484 if (MD_UPD_CA_URL & fields) {
485 nmd->ca_urls = (updates->ca_urls?
486 apr_array_copy(p, updates->ca_urls) : NULL);
487 md_log_perror(MD_LOG_MARK, MD_LOG_TRACE1, 0, ptemp, "update ca url: %s", name);
488 }
489 if (MD_UPD_CA_PROTO & fields) {
490 nmd->ca_proto = updates->ca_proto;
491 md_log_perror(MD_LOG_MARK, MD_LOG_TRACE1, 0, ptemp, "update ca protocol: %s", name);
492 }
493 if (MD_UPD_CA_ACCOUNT & fields) {
494 nmd->ca_account = updates->ca_account;
495 md_log_perror(MD_LOG_MARK, MD_LOG_TRACE1, 0, ptemp, "update account: %s", name);
496 }
497 if (MD_UPD_CONTACTS & fields) {
498 nmd->contacts = updates->contacts;
499 md_log_perror(MD_LOG_MARK, MD_LOG_TRACE1, 0, ptemp, "update contacts: %s", name);
500 }
501 if (MD_UPD_AGREEMENT & fields) {
502 md_log_perror(MD_LOG_MARK, MD_LOG_TRACE1, 0, ptemp, "update agreement: %s", name);
503 nmd->ca_agreement = updates->ca_agreement;
504 }
505 if (MD_UPD_DRIVE_MODE & fields) {
506 md_log_perror(MD_LOG_MARK, MD_LOG_TRACE1, 0, ptemp, "update drive-mode: %s", name);
507 nmd->renew_mode = updates->renew_mode;
508 }
509 if (MD_UPD_RENEW_WINDOW & fields) {
510 md_log_perror(MD_LOG_MARK, MD_LOG_TRACE1, 0, ptemp, "update renew-window: %s", name);

Callers

nothing calls this directly

Calls 7

md_reg_getFunction · 0.85
md_log_perrorFunction · 0.85
check_valuesFunction · 0.85
md_copyFunction · 0.85
md_pkeys_spec_cloneFunction · 0.85
md_saveFunction · 0.85
state_initFunction · 0.85

Tested by

no test coverage detected