| 155 | } |
| 156 | |
| 157 | static apr_status_t run_watchdog(int state, void *baton, apr_pool_t *ptemp) |
| 158 | { |
| 159 | md_ocsp_ctx_t *octx = baton; |
| 160 | apr_time_t next_run, wait_time; |
| 161 | |
| 162 | /* mod_watchdog invoked us as a single thread inside the whole server (on this machine). |
| 163 | * This might be a repeated run inside the same child (mod_watchdog keeps affinity as |
| 164 | * long as the child lives) or another/new child. |
| 165 | */ |
| 166 | switch (state) { |
| 167 | case AP_WATCHDOG_STATE_STARTING: |
| 168 | ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, octx->s, APLOGNO(10197) |
| 169 | "md ocsp watchdog start, ocsp stapling %d certificates", |
| 170 | (int)md_ocsp_count(octx->mc->ocsp)); |
| 171 | break; |
| 172 | |
| 173 | case AP_WATCHDOG_STATE_RUNNING: |
| 174 | ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, octx->s, APLOGNO(10198) |
| 175 | "md ocsp watchdog run, ocsp stapling %d certificates", |
| 176 | (int)md_ocsp_count(octx->mc->ocsp)); |
| 177 | |
| 178 | /* Process all drive jobs. They will update their next_run property |
| 179 | * and we schedule ourself at the earliest of all. A job may specify 0 |
| 180 | * as next_run to indicate that it wants to participate in the normal |
| 181 | * regular runs. */ |
| 182 | next_run = next_run_default(); |
| 183 | |
| 184 | md_ocsp_renew(octx->mc->ocsp, octx->p, ptemp, &next_run); |
| 185 | |
| 186 | wait_time = next_run - apr_time_now(); |
| 187 | if (APLOGdebug(octx->s)) { |
| 188 | ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, octx->s, APLOGNO(10199) |
| 189 | "md ocsp watchdog next run in %s", |
| 190 | md_duration_print(ptemp, wait_time)); |
| 191 | } |
| 192 | wd_set_interval(octx->watchdog, wait_time, octx, run_watchdog); |
| 193 | break; |
| 194 | |
| 195 | case AP_WATCHDOG_STATE_STOPPING: |
| 196 | ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, octx->s, APLOGNO(10200) |
| 197 | "md ocsp watchdog stopping"); |
| 198 | break; |
| 199 | } |
| 200 | |
| 201 | return APR_SUCCESS; |
| 202 | } |
| 203 | |
| 204 | static apr_status_t ocsp_remove_old_responses(md_mod_conf_t *mc, apr_pool_t *p) |
| 205 | { |
nothing calls this directly
no test coverage detected