MCPcopy Create free account
hub / github.com/apache/trafficserver / RecRegisterConfig

Function RecRegisterConfig

src/records/RecCore.cc:739–764  ·  view source on GitHub ↗

------------------------------------------------------------------------- RecRegisterConfig -------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

737// RecRegisterConfig
738//-------------------------------------------------------------------------
739RecRecord *
740RecRegisterConfig(RecT rec_type, const char *name, RecDataT data_type, RecData data_default, RecUpdateT update_type,
741 RecCheckT check_type, const char *check_expr, RecSourceT source, RecAccessT access_type)
742{
743 RecRecord *r;
744 bool updated_p;
745
746 ink_rwlock_wrlock(&g_records_rwlock);
747 if ((r = register_record(rec_type, name, data_type, data_default, RECP_NULL, &updated_p)) != nullptr) {
748 // Note: do not modify 'record->config_meta.update_required'
749 r->config_meta.update_type = update_type;
750 r->config_meta.check_type = check_type;
751
752 ats_free(r->config_meta.check_expr);
753
754 r->config_meta.check_expr = ats_strdup(check_expr);
755 r->config_meta.update_cb_list = nullptr;
756 r->config_meta.access_type = access_type;
757 if (!updated_p) {
758 r->config_meta.source = source;
759 }
760 }
761 ink_rwlock_unlock(&g_records_rwlock);
762
763 return r;
764}
765
766//-------------------------------------------------------------------------
767// RecGetRecord_Xmalloc

Callers

nothing calls this directly

Calls 4

ink_rwlock_wrlockFunction · 0.85
register_recordFunction · 0.85
ats_freeFunction · 0.85
ink_rwlock_unlockFunction · 0.85

Tested by

no test coverage detected