Changeset ad0d1f5 in mainline
- Timestamp:
- 2018-04-10T19:43:21Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 64532a97
- Parents:
- ae84e38
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/rfb/rfb.c
rae84e38 rad0d1f5 83 83 84 84 /** Receive count characters (with buffering) */ 85 __attribute__((warn_unused_result)) 85 86 static errno_t recv_chars(tcp_conn_t *conn, char *c, size_t count) 86 87 { … … 216 217 } 217 218 219 __attribute__((warn_unused_result)) 218 220 static errno_t recv_message(tcp_conn_t *conn, char type, void *buf, size_t size) 219 221 { … … 690 692 if (rc != EOK) { 691 693 log_msg(LOG_DEFAULT, LVL_WARN, 692 "Failed receiving client message type"); 694 "Failed receiving client message type: %s", 695 str_error(rc)); 693 696 return; 694 697 } … … 702 705 switch (message_type) { 703 706 case RFB_CMSG_SET_PIXEL_FORMAT: 704 recv_message(conn, message_type, &spf, sizeof(spf)); 707 rc = recv_message(conn, message_type, &spf, sizeof(spf)); 708 if (rc != EOK) { 709 log_msg(LOG_DEFAULT, LVL_WARN, 710 "Failed receiving client message: %s", 711 str_error(rc)); 712 return; 713 } 705 714 rfb_pixel_format_to_host(&spf.pixel_format, &spf.pixel_format); 706 715 log_msg(LOG_DEFAULT, LVL_DEBUG2, "Received SetPixelFormat message"); … … 712 721 break; 713 722 case RFB_CMSG_SET_ENCODINGS: 714 recv_message(conn, message_type, &se, sizeof(se)); 723 rc = recv_message(conn, message_type, &se, sizeof(se)); 724 if (rc != EOK) { 725 log_msg(LOG_DEFAULT, LVL_WARN, 726 "Failed receiving client message: %s", 727 str_error(rc)); 728 return; 729 } 715 730 rfb_set_encodings_to_host(&se, &se); 716 731 log_msg(LOG_DEFAULT, LVL_DEBUG2, "Received SetEncodings message"); … … 729 744 break; 730 745 case RFB_CMSG_FRAMEBUFFER_UPDATE_REQUEST: 731 recv_message(conn, message_type, &fbur, sizeof(fbur)); 746 rc = recv_message(conn, message_type, &fbur, sizeof(fbur)); 747 if (rc != EOK) { 748 log_msg(LOG_DEFAULT, LVL_WARN, 749 "Failed receiving client message: %s", 750 str_error(rc)); 751 return; 752 } 732 753 rfb_framebuffer_update_request_to_host(&fbur, &fbur); 733 754 log_msg(LOG_DEFAULT, LVL_DEBUG2, … … 736 757 break; 737 758 case RFB_CMSG_KEY_EVENT: 738 recv_message(conn, message_type, &ke, sizeof(ke)); 759 rc = recv_message(conn, message_type, &ke, sizeof(ke)); 760 if (rc != EOK) { 761 log_msg(LOG_DEFAULT, LVL_WARN, 762 "Failed receiving client message: %s", 763 str_error(rc)); 764 return; 765 } 739 766 rfb_key_event_to_host(&ke, &ke); 740 767 log_msg(LOG_DEFAULT, LVL_DEBUG2, "Received KeyEvent message"); 741 768 break; 742 769 case RFB_CMSG_POINTER_EVENT: 743 recv_message(conn, message_type, &pe, sizeof(pe)); 770 rc = recv_message(conn, message_type, &pe, sizeof(pe)); 771 if (rc != EOK) { 772 log_msg(LOG_DEFAULT, LVL_WARN, 773 "Failed receiving client message: %s", 774 str_error(rc)); 775 return; 776 } 744 777 rfb_pointer_event_to_host(&pe, &pe); 745 778 log_msg(LOG_DEFAULT, LVL_DEBUG2, "Received PointerEvent message"); 746 779 break; 747 780 case RFB_CMSG_CLIENT_CUT_TEXT: 748 recv_message(conn, message_type, &cct, sizeof(cct)); 781 rc = recv_message(conn, message_type, &cct, sizeof(cct)); 782 if (rc != EOK) { 783 log_msg(LOG_DEFAULT, LVL_WARN, 784 "Failed receiving client message: %s", 785 str_error(rc)); 786 return; 787 } 749 788 rfb_client_cut_text_to_host(&cct, &cct); 750 789 log_msg(LOG_DEFAULT, LVL_DEBUG2, "Received ClientCutText message");
Note:
See TracChangeset
for help on using the changeset viewer.