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

Function run_init

modules/md/md_reg.c:1085–1150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1083/* driving */
1084
1085static apr_status_t run_init(void *baton, apr_pool_t *p, ...)
1086{
1087 va_list ap;
1088 md_reg_t *reg = baton;
1089 const md_t *md;
1090 md_proto_driver_t *driver, **pdriver;
1091 md_result_t *result;
1092 apr_table_t *env;
1093 const char *s;
1094 int preload;
1095
1096 (void)p;
1097 va_start(ap, p);
1098 pdriver = va_arg(ap, md_proto_driver_t **);
1099 md = va_arg(ap, const md_t *);
1100 preload = va_arg(ap, int);
1101 env = va_arg(ap, apr_table_t *);
1102 result = va_arg(ap, md_result_t *);
1103 va_end(ap);
1104
1105 *pdriver = driver = apr_pcalloc(p, sizeof(*driver));
1106
1107 driver->p = p;
1108 driver->env = env? apr_table_copy(p, env) : apr_table_make(p, 10);
1109 driver->reg = reg;
1110 driver->store = md_reg_store_get(reg);
1111 driver->proxy_url = reg->proxy_url;
1112 driver->ca_file = reg->ca_file;
1113 driver->md = md;
1114 driver->can_http = reg->can_http;
1115 driver->can_https = reg->can_https;
1116
1117 s = apr_table_get(driver->env, MD_KEY_ACTIVATION_DELAY);
1118 if (!s || APR_SUCCESS != md_duration_parse(&driver->activation_delay, s, "d")) {
1119 driver->activation_delay = 0;
1120 }
1121
1122 if (!md->ca_proto) {
1123 md_result_printf(result, APR_EGENERAL, "CA protocol is not defined");
1124 md_log_perror(MD_LOG_MARK, MD_LOG_WARNING, 0, p, "md[%s]: %s", md->name, result->detail);
1125 goto leave;
1126 }
1127
1128 driver->proto = apr_hash_get(reg->protos, md->ca_proto, (apr_ssize_t)strlen(md->ca_proto));
1129 if (!driver->proto) {
1130 md_result_printf(result, APR_EGENERAL, "Unknown CA protocol '%s'", md->ca_proto);
1131 goto leave;
1132 }
1133
1134 if (preload) {
1135 result->status = driver->proto->init_preload(driver, result);
1136 }
1137 else {
1138 result->status = driver->proto->init(driver, result);
1139 }
1140
1141leave:
1142 if (APR_SUCCESS != result->status) {

Callers 4

run_test_initFunction · 0.85
run_renewFunction · 0.85
run_get_ariFunction · 0.85
run_load_stagingFunction · 0.85

Calls 4

md_reg_store_getFunction · 0.85
md_duration_parseFunction · 0.85
md_result_printfFunction · 0.85
md_log_perrorFunction · 0.85

Tested by

no test coverage detected