Add even more events
parent
e42b8ffa92
commit
11f44c7223
|
@ -106,6 +106,13 @@ struct rfb_client_pointer_event_msg {
|
||||||
uint16_t y;
|
uint16_t y;
|
||||||
} RFB_PACKED;
|
} RFB_PACKED;
|
||||||
|
|
||||||
|
struct rfb_client_cut_text_msg {
|
||||||
|
uint8_t type;
|
||||||
|
uint8_t padding[3];
|
||||||
|
uint32_t length;
|
||||||
|
char test[0];
|
||||||
|
} RFB_PACKED;
|
||||||
|
|
||||||
static inline int rfb_send_security_types(void *client)
|
static inline int rfb_send_security_types(void *client)
|
||||||
{
|
{
|
||||||
struct rfb_security_types_msg payload = {
|
struct rfb_security_types_msg payload = {
|
||||||
|
|
15
server.c
15
server.c
|
@ -517,6 +517,19 @@ static int on_client_pointer_event(struct vnc_client *client)
|
||||||
return sizeof(*msg);
|
return sizeof(*msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int on_client_cut_text(struct vnc_client *client)
|
||||||
|
{
|
||||||
|
struct rfb_client_cut_text_msg *msg =
|
||||||
|
(struct rfb_client_cut_text_msg*)(client->msg_buffer +
|
||||||
|
client->buffer_index);
|
||||||
|
|
||||||
|
uint32_t length = ntohl(msg->length);
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
return sizeof(*msg) + length;
|
||||||
|
}
|
||||||
|
|
||||||
static int on_client_message(struct vnc_client *client)
|
static int on_client_message(struct vnc_client *client)
|
||||||
{
|
{
|
||||||
if (client->buffer_len - client->buffer_index < 1)
|
if (client->buffer_len - client->buffer_index < 1)
|
||||||
|
@ -537,7 +550,7 @@ static int on_client_message(struct vnc_client *client)
|
||||||
case RFB_CLIENT_TO_SERVER_POINTER_EVENT:
|
case RFB_CLIENT_TO_SERVER_POINTER_EVENT:
|
||||||
return on_client_pointer_event(client);
|
return on_client_pointer_event(client);
|
||||||
case RFB_CLIENT_TO_SERVER_CLIENT_CUT_TEXT:
|
case RFB_CLIENT_TO_SERVER_CLIENT_CUT_TEXT:
|
||||||
break;
|
return on_client_cut_text(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
uv_close((uv_handle_t*)&client->stream_handle, cleanup_client);
|
uv_close((uv_handle_t*)&client->stream_handle, cleanup_client);
|
||||||
|
|
Loading…
Reference in New Issue