diff --git a/graphics/vnc/server/vnc_server.c b/graphics/vnc/server/vnc_server.c index cdfbc0058f..9e02130173 100644 --- a/graphics/vnc/server/vnc_server.c +++ b/graphics/vnc/server/vnc_server.c @@ -120,16 +120,26 @@ int vnc_server(int argc, FAR char *argv[]) { gvdbg("New VNC connection\n"); - /* Start the VNC session. This function does not return until the - * session has been terminated (or an error occurs). - */ + ret = vnc_negotiate(session); + if (ret < 0) + { + gdbg("ERROR: Failed to negotiate security/framebuffer: %d\n", + ret); + } + else + { + /* Start the VNC session. This function does not return until + * the session has been terminated (or an error occurs). + */ - (void)vnc_session(session); - - /* Re-initialize the session structure for re-use */ - - vnc_release_session(session); + ret = vnc_session(session); + gvdbg("Session terminated with %d\n", ret); + } } + + /* Re-initialize the session structure for re-use */ + + vnc_release_session(session); } return EXIT_FAILURE; /* We won't get here */ diff --git a/graphics/vnc/server/vnc_server.h b/graphics/vnc/server/vnc_server.h index 256e4864f1..21b15711f6 100644 --- a/graphics/vnc/server/vnc_server.h +++ b/graphics/vnc/server/vnc_server.h @@ -250,6 +250,25 @@ FAR struct vnc_session_s *vnc_create_session(void); void vnc_release_session(FAR struct vnc_session_s *session); +/**************************************************************************** + * Name: vnc_negotiate + * + * Description: + * Perform the VNC initialize sequency after a client has sucessfully + * connected to the server. Negotiate security, framebuffer and color + * properties. + * + * Input Parameters: + * session - An instance of the session structure allocated by + * vnc_create_session(). + * + * Returned Value: + * Returns zero (OK) on success; a negated errno value on failure. + * + ****************************************************************************/ + +int vnc_negotiate(FAR struct vnc_session_s *session); + /**************************************************************************** * Name: vnc_session *