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

Function ap_dbd_acquire

modules/database/mod_dbd.c:873–904  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

871}
872
873DBD_DECLARE_NONSTD(ap_dbd_t *) ap_dbd_acquire(request_rec *r)
874{
875 dbd_acquire_t *acq;
876
877 while (!ap_is_initial_req(r)) {
878 if (r->prev) {
879 r = r->prev;
880 }
881 else if (r->main) {
882 r = r->main;
883 }
884 }
885
886 acq = ap_get_module_config(r->request_config, &dbd_module);
887 if (!acq) {
888 acq = apr_palloc(r->pool, sizeof(dbd_acquire_t));
889 acq->rec = ap_dbd_open(r->pool, r->server);
890 if (acq->rec) {
891 svr_cfg *svr = ap_get_module_config(r->server->module_config,
892 &dbd_module);
893
894 ap_set_module_config(r->request_config, &dbd_module, acq);
895 if (svr->cfg->persist) {
896 acq->reslist = svr->group->reslist;
897 apr_pool_cleanup_register(r->pool, acq, dbd_release,
898 apr_pool_cleanup_null);
899 }
900 }
901 }
902
903 return acq->rec;
904}
905
906DBD_DECLARE_NONSTD(ap_dbd_t *) ap_dbd_cacquire(conn_rec *c)
907{

Callers

nothing calls this directly

Calls 4

ap_is_initial_reqFunction · 0.85
ap_get_module_configFunction · 0.85
ap_dbd_openFunction · 0.85
ap_set_module_configFunction · 0.85

Tested by

no test coverage detected