Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
SuprHackerSteve committed Apr 18, 2020
1 parent 15bdbd0 commit 2c41c20
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
17 changes: 8 additions & 9 deletions CrescendoExtension/IPCConnection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ class IPCConnection: NSObject {
}

func terminateESClient() {
if self.client != nil {
let ret = disableCrescendo(esclient: self.client!)
if client != nil {
let ret = disableCrescendo(esclient: client!)
if ret != CrescendoError.success {
NSLog("Failed to disable Crescendo listener")
}
}
self.client = nil
client = nil
}

func sendEventToApp(newEvent event: String) {
Expand Down Expand Up @@ -161,9 +161,9 @@ func sender(event: CrescendoEvent) {
let encoder = JSONEncoder()
encoder.outputFormatting = .prettyPrinted
guard let data = try? encoder.encode(event)
else {
NSLog("Failed to seralize event")
return
else {
NSLog("Failed to seralize event")
return
}
guard let json = String(data: data, encoding: .utf8) else {
NSLog("Invalid json encode.")
Expand All @@ -186,8 +186,8 @@ extension IPCConnection: ProviderCommunication {
func register(_ completionHandler: @escaping (Bool) -> Void) {
NSLog("App client connected.")

if self.client == nil {
self.client = startCrescendoClient()
if client == nil {
client = startCrescendoClient()
NSLog("Created esclient.")
}
completionHandler(true)
Expand All @@ -206,5 +206,4 @@ extension IPCConnection: ProviderCommunication {
}
response(client.getCrescendoBlacklist())
}

}
4 changes: 2 additions & 2 deletions libCrescendo/esclient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ public class ESClient {
}

func stopEventProducer() {
if connected && client != nil {
if connected, client != nil {
connected = false
if ES_RETURN_ERROR == es_unsubscribe(client!, self.subEvents, UInt32(self.subEvents.count)) {
if ES_RETURN_ERROR == es_unsubscribe(client!, subEvents, UInt32(subEvents.count)) {
NSLog("Failed to unsubscibe to ESF")
}
if ES_RETURN_ERROR == es_delete_client(client!) {
Expand Down
2 changes: 1 addition & 1 deletion libCrescendo/events.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ extension ESClient {
let proc: es_process_t = msg.pointee.event.exec.target.pointee
cEvent.props = getProcessProps(proc: proc, exec: msg.pointee.event.exec)

//overwrite the parent process items with the current target exec
// overwrite the parent process items with the current target exec
let path = proc.executable.pointee.path

cEvent.processpath = getString(tok: path)
Expand Down

0 comments on commit 2c41c20

Please sign in to comment.