Exit if enabling auth fails

pull/66/head
Andri Yngvason 2020-08-23 13:10:59 +00:00
parent e67e4b5985
commit 7ef8d0b0ae
1 changed files with 6 additions and 3 deletions

View File

@ -475,9 +475,12 @@ int init_nvnc(struct wayvnc* self, const char* addr, uint16_t port)
nvnc_display_set_render_fn(self->nvnc_display, on_render);
if (self->cfg.enable_auth)
nvnc_enable_auth(self->nvnc, self->cfg.private_key_file,
self->cfg.certificate_file, on_auth, self);
if (self->cfg.enable_auth &&
nvnc_enable_auth(self->nvnc, self->cfg.private_key_file,
self->cfg.certificate_file, on_auth, self) < 0) {
log_error("Failed to enable authentication\n");
goto failure;
}
if (self->pointer_manager)
nvnc_set_pointer_fn(self->nvnc, on_pointer_event);