mirror of
https://github.com/openziti/desktop-edge-win.git
synced 2026-10-14 00:29:48 +00:00
stub out ziti_shutdown...
This commit is contained in:
@@ -26,6 +26,7 @@ package cziti
|
||||
#include "ziti/ziti_log.h"
|
||||
|
||||
#include "sdk.h"
|
||||
extern void doZitiShutdown(uv_async_t *handle);
|
||||
extern void zitiContextEvent(ziti_context nf, int status, void *ctx);
|
||||
extern void eventCB(ziti_context ztx, ziti_event_t *event);
|
||||
|
||||
@@ -212,6 +213,22 @@ func (c *ZIdentity) Controller() string {
|
||||
return C.GoString(c.Options.controller)
|
||||
}
|
||||
|
||||
func (zid *ZIdentity) Shutdown() {
|
||||
|
||||
async := (*C.uv_async_t)(C.malloc(C.sizeof_uv_async_t))
|
||||
async.data = unsafe.Pointer(zid.czctx)
|
||||
log.Debugf("setting up call to ziti_shutdown for context %p using uv_async_t", async.data)
|
||||
C.uv_async_init(_impl.libuvCtx.l, async, C.uv_async_cb(C.doZitiShutdown))
|
||||
C.uv_async_send((*C.uv_async_t)(unsafe.Pointer(async)))
|
||||
}
|
||||
|
||||
//export doZitiShutdown
|
||||
func doZitiShutdown(async *C.uv_async_t) {
|
||||
ctx := C.ziti_context(async.data)
|
||||
log.Infof("invoking ziti_shutdown for context %p", &ctx)
|
||||
C.ziti_shutdown(ctx)
|
||||
}
|
||||
|
||||
var cTunClientCfgName = C.CString("ziti-tunneler-client.v1")
|
||||
var cTunServerCfgName = C.CString("ziti-tunneler-server.v1")
|
||||
|
||||
|
||||
@@ -846,6 +846,7 @@ func removeIdentity(out *json.Encoder, fingerprint string) {
|
||||
|
||||
resp := dto.Response{Message: "success", Code: SUCCESS, Error: anyErrs, Payload: nil}
|
||||
respond(out, resp)
|
||||
// call shutdown some day id.CId.Shutdown()
|
||||
log.Infof("request to remove identity by fingerprint: %s responded to", fingerprint)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user