VNC: Add control logic to negotiate security and framebuffer
This commit is contained in:
parent
db99f73a40
commit
d13962ef74
2 changed files with 37 additions and 8 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue