diff --git a/service/cziti/sdk.go b/service/cziti/sdk.go index e8b1fd24..0f2e03f7 100644 --- a/service/cziti/sdk.go +++ b/service/cziti/sdk.go @@ -375,7 +375,6 @@ func serviceCB(ziti_ctx C.ziti_context, service *C.ziti_service, status C.int, z for _, pc := range postureChecks { if pc.Id == C.GoString(pq.id) { if timeout == -1 || timeout > int(pq.timeout) { - // pc.Timeout = int(pq.timeout) timeout = int(pq.timeout) } break diff --git a/service/ziti-tunnel/service/ipc.go b/service/ziti-tunnel/service/ipc.go index d3de2f21..412a40e5 100644 --- a/service/ziti-tunnel/service/ipc.go +++ b/service/ziti-tunnel/service/ipc.go @@ -118,7 +118,9 @@ func SubMain(ops chan string, changes chan<- svc.Status, winEvents <-chan Window if wEvents.WinSessionEvent == WTS_SESSION_UNLOCK { log.Debugf("Received Windows Session Event (device unlocked) in tunnel %d", wEvents.WinSessionEvent) for _, id := range rts.ids { - cziti.EndpointStateChanged(id.CId, false, true) + if id.CId != nil && id.CId.Loaded { + cziti.EndpointStateChanged(id.CId, false, true) + } } } case <-shutdownDelay: @@ -1114,7 +1116,7 @@ func handleEvents(isInitialized chan struct{}) { events.run() d := 5 * time.Second every5s := time.NewTicker(d) - notificationFrequency := time.NewTicker(time.Duration(5) * time.Second) + notificationFrequency := time.NewTicker(time.Duration(5) * time.Minute) defer log.Debugf("exiting handleEvents. loops were set for %v", d) <-isInitialized @@ -1144,6 +1146,10 @@ func handleEvents(isInitialized chan struct{}) { //string, ZService val := value.(*cziti.ZService) + if val.Service.Timeout <= 0 { + return true + } + var svcTimeout int32 = -1 for _, pc := range val.Service.PostureChecks { if svcTimeout == -1 || svcTimeout > int32(pc.Timeout) {