Skip to content

Commit

Permalink
santad: Add some TODOs related to cache
Browse files Browse the repository at this point in the history
  • Loading branch information
russellhancox committed Jan 11, 2021
1 parent 4ee3f28 commit a9e5bf0
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ @implementation SNTCachingEndpointSecurityManager {
- (instancetype)init {
self = [super init];
if (self) {
// TODO(rah): Consider splitting into root/non-root cache
_decisionCache = new SantaCache<santa_vnode_id_t, uint64_t>();
}

Expand Down Expand Up @@ -62,8 +63,7 @@ - (BOOL)respondFromCache:(es_message_t *)m API_AVAILABLE(macos(10.15)) {
}
return YES;
} else if (return_action == ACTION_REQUEST_BINARY || return_action == ACTION_RESPOND_ACK) {
// TODO: Figure out a replacement for this:
//msleep((void *)vnode_id.unsafe_simple_id(), NULL, 0, "", &ts_);
// TODO(rah): Look at a replacement for msleep(), maybe NSCondition
usleep(5000);
} else {
break;
Expand Down Expand Up @@ -140,8 +140,7 @@ - (void)addToCache:(santa_vnode_id_t)identifier
default:
break;
}
// TODO: Figure out a replacement for this:
// wakeup((void *)identifier.unsafe_simple_id());
// TODO(rah): Look at a replacement for wakeup(), maybe NSCondition
}

- (BOOL)flushCacheNonRootOnly:(BOOL)nonRootOnly API_AVAILABLE(macos(10.15)) {
Expand Down Expand Up @@ -184,8 +183,7 @@ - (santa_action_t)checkCache:(santa_vnode_id_t)vnodeID {

- (kern_return_t)removeCacheEntryForVnodeID:(santa_vnode_id_t)vnodeID {
_decisionCache->remove(vnodeID);
// TODO: Figure out a replacement for this:
// wakeup((void *)identifier.unsafe_simple_id());
// TODO(rah): Look at a replacement for wakeup(), maybe NSCondition
return 0;
}

Expand Down

0 comments on commit a9e5bf0

Please sign in to comment.