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

Function RecGetRecordString

src/records/RecCore.cc:426–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

424}
425
426RecErrT
427RecGetRecordString(const char *name, char *buf, int buf_len, bool lock)
428{
429 RecErrT err = REC_ERR_OKAY;
430
431 if (lock) {
432 ink_rwlock_rdlock(&g_records_rwlock);
433 }
434 if (auto it = g_records_ht.find(name); it != g_records_ht.end()) {
435 RecRecord *r = it->second;
436
437 rec_mutex_acquire(&(r->lock));
438 if (!r->registered || (r->data_type != RECD_STRING)) {
439 err = REC_ERR_FAIL;
440 } else {
441 if (r->data.rec_string == nullptr) {
442 buf[0] = '\0';
443 } else {
444 ink_strlcpy(buf, r->data.rec_string, buf_len);
445 }
446 }
447 rec_mutex_release(&(r->lock));
448 } else {
449 err = REC_ERR_FAIL;
450 }
451 if (lock) {
452 ink_rwlock_unlock(&g_records_rwlock);
453 }
454 return err;
455}
456
457RecErrT
458RecGetRecordString_Xmalloc(const char *name, RecString *rec_string, bool lock)

Callers 14

RecConfigReadRuntimeDirFunction · 0.85
RecConfigReadLogDirFunction · 0.85
RecConfigReadBinDirFunction · 0.85
RecConfigReadPluginDirFunction · 0.85
RecConfigReadConfigPathFunction · 0.85
RecHttpLoadIpFunction · 0.85
verify_runrootMethod · 0.85
http_config_enum_readFunction · 0.85
startupMethod · 0.85
loadMethod · 0.85

Calls 7

ink_rwlock_rdlockFunction · 0.85
rec_mutex_acquireFunction · 0.85
ink_strlcpyFunction · 0.85
rec_mutex_releaseFunction · 0.85
ink_rwlock_unlockFunction · 0.85
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected