static void do_agent_xorg_resolution(UdscsConnection             *conn,
                                     struct udscs_message_header *header,
                                     guint8                      *data)
{
    struct agent_data *agent_data = g_object_get_data(G_OBJECT(conn), "agent_data");
    guint res_size = sizeof(struct vdagentd_guest_xorg_resolution);
    guint n = header->size / res_size;

    /* Detect older version session agent, but don't disconnect, as
     * that stops it from getting the VDAGENTD_VERSION message, and then
     * it will never re-exec the new version... */
    if (header->arg1 == 0 && header->arg2 == 0) {
        syslog(LOG_INFO, "got old session agent xorg resolution message, "
                         "ignoring");
        return;
    }

    if (header->size != n * res_size) {
        syslog(LOG_ERR, "guest xorg resolution message has wrong size, "
                        "disconnecting agent");
        udscs_server_destroy_connection(server, conn);
        return;
    }

    g_free(agent_data->screen_info);
    agent_data->screen_info = g_memdup(data, header->size);
    agent_data->width  = header->arg1;
    agent_data->height = header->arg2;
    agent_data->screen_count = n;

    check_xorg_resolution();
}
static void do_agent_xorg_resolution(UdscsConnection             *conn,
                                     struct udscs_message_header *header,
                                     guint8                      *data)
{
    struct agent_data *agent_data = g_object_get_data(G_OBJECT(conn), "agent_data");
    guint res_size = sizeof(struct vdagentd_guest_xorg_resolution);
    guint n = header->size / res_size;

     
    if (header->arg1 == 0 && header->arg2 == 0) {
        syslog(LOG_INFO, "got old session agent xorg resolution message, "
                         "ignoring");
        return;
    }

    if (header->size != n * res_size) {
        syslog(LOG_ERR, "guest xorg resolution message has wrong size, "
                        "disconnecting agent");
        udscs_server_destroy_connection(server, conn);
        return;
    }

    g_free(agent_data->screen_info);
    agent_data->screen_info = g_memdup(data, header->size);
    agent_data->width  = header->arg1;
    agent_data->height = header->arg2;
    agent_data->screen_count = n;

    check_xorg_resolution();
}