MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / ACLLogMatchEntry

Function ACLLogMatchEntry

src/acl.cpp:1780–1789  ·  view source on GitHub ↗

This function will check if ACL entries 'a' and 'b' are similar enough * that we should actually update the existing entry in our ACL log instead * of creating a new one. */

Source from the content-addressed store, hash-verified

1778 * that we should actually update the existing entry in our ACL log instead
1779 * of creating a new one. */
1780int ACLLogMatchEntry(ACLLogEntry *a, ACLLogEntry *b) {
1781 if (a->reason != b->reason) return 0;
1782 if (a->context != b->context) return 0;
1783 mstime_t delta = a->ctime - b->ctime;
1784 if (delta < 0) delta = -delta;
1785 if (delta > ACL_LOG_GROUPING_MAX_TIME_DELTA) return 0;
1786 if (sdscmp(a->object,b->object) != 0) return 0;
1787 if (sdscmp(a->username,b->username) != 0) return 0;
1788 return 1;
1789}
1790
1791/* Release an ACL log entry. */
1792void ACLFreeLogEntry(const void *leptr) {

Callers 1

addACLLogEntryFunction · 0.85

Calls 1

sdscmpFunction · 0.85

Tested by

no test coverage detected