VNC: Add more debug output; fix a bad assertion

This commit is contained in:
Gregory Nutt 2016-04-18 19:02:40 -06:00
parent 6cfe56202d
commit 1ae24ddf77
2 changed files with 13 additions and 5 deletions

View File

@ -150,6 +150,8 @@ int vnc_receiver(FAR struct vnc_session_s *session)
{ {
case RFB_SETPIXELFMT_MSG: /* SetPixelFormat */ case RFB_SETPIXELFMT_MSG: /* SetPixelFormat */
{ {
gvdbg("Received SetPixelFormat\n");
/* Read the rest of the SetPixelFormat message */ /* Read the rest of the SetPixelFormat message */
ret = vnc_read_remainder(session, ret = vnc_read_remainder(session,
@ -172,6 +174,8 @@ int vnc_receiver(FAR struct vnc_session_s *session)
FAR struct rfb_setencodings_s *encodings; FAR struct rfb_setencodings_s *encodings;
uint32_t nencodings; uint32_t nencodings;
gvdbg("Received SetEncodings\n");
/* Read the SetEncodings message without the following /* Read the SetEncodings message without the following
* encodings. * encodings.
*/ */
@ -212,6 +216,8 @@ int vnc_receiver(FAR struct vnc_session_s *session)
FAR struct rfb_fbupdatereq_s *update; FAR struct rfb_fbupdatereq_s *update;
struct nxgl_rect_s rect; struct nxgl_rect_s rect;
gvdbg("Received FramebufferUpdateRequest\n");
/* Read the rest of the SetPixelFormat message */ /* Read the rest of the SetPixelFormat message */
ret = vnc_read_remainder(session, ret = vnc_read_remainder(session,
@ -246,6 +252,8 @@ int vnc_receiver(FAR struct vnc_session_s *session)
{ {
FAR struct rfb_keyevent_s *keyevent; FAR struct rfb_keyevent_s *keyevent;
gvdbg("Received KeyEvent\n");
/* Read the rest of the KeyEvent message */ /* Read the rest of the KeyEvent message */
ret = vnc_read_remainder(session, ret = vnc_read_remainder(session,
@ -273,6 +281,7 @@ int vnc_receiver(FAR struct vnc_session_s *session)
FAR struct rfb_pointerevent_s *event; FAR struct rfb_pointerevent_s *event;
uint8_t buttons; uint8_t buttons;
#endif #endif
gvdbg("Received PointerEvent\n");
/* Read the rest of the PointerEvent message */ /* Read the rest of the PointerEvent message */
@ -328,6 +337,8 @@ int vnc_receiver(FAR struct vnc_session_s *session)
FAR struct rfb_clientcuttext_s *cuttext; FAR struct rfb_clientcuttext_s *cuttext;
uint32_t length; uint32_t length;
gvdbg("Received ClientCutText\n");
/* Read the ClientCutText message without the following /* Read the ClientCutText message without the following
* text. * text.
*/ */

View File

@ -193,7 +193,7 @@ static int vnc_connect(FAR struct vnc_session_s *session, int port)
/* Connect to the client */ /* Connect to the client */
gvdbg("Acception connection for display %d\n", session->display); gvdbg("Accepting connection for Display %d\n", session->display);
ret = psock_accept(&session->listen, NULL, NULL, &session->connect); ret = psock_accept(&session->listen, NULL, NULL, &session->connect);
if (ret < 0) if (ret < 0)
@ -236,9 +236,6 @@ int vnc_server(int argc, FAR char *argv[])
int display; int display;
int ret; int ret;
gvdbg("Server Started\n");
DEBUGASSERT(session != NULL);
/* A single argument is expected: A diplay port number in ASCII form */ /* A single argument is expected: A diplay port number in ASCII form */
if (argc != 2) if (argc != 2)
@ -256,7 +253,7 @@ int vnc_server(int argc, FAR char *argv[])
goto errout_with_post; goto errout_with_post;
} }
gvdbg("Display %d\n", display); gvdbg("Server started for Display %d\n", display);
/* Allocate the framebuffer memory. We rely on the fact that /* Allocate the framebuffer memory. We rely on the fact that
* the KMM allocator will align memory to 32-bits or better. * the KMM allocator will align memory to 32-bits or better.