Merge pull request #316 from proski/32bpp

Make it possible to use Xvnc with 32 bpp
ulab-next-nosound
Itamar Reis Peixoto 9 years ago
commit 70920b836e

@ -137,6 +137,7 @@ scp_session_set_bpp(struct SCP_SESSION *s, tui8 bpp)
case 15: case 15:
case 16: case 16:
case 24: case 24:
case 32:
s->bpp = bpp; s->bpp = bpp;
default: default:
return 1; return 1;

@ -252,7 +252,14 @@ scp_v0s_accept(struct SCP_CONNECTION *c, struct SCP_SESSION **s, int skipVchk)
scp_session_set_height(session, sz); scp_session_set_height(session, sz);
/* bpp */ /* bpp */
in_uint16_be(c->in_s, sz); in_uint16_be(c->in_s, sz);
scp_session_set_bpp(session, (tui8)sz); if (0 != scp_session_set_bpp(session, (tui8)sz))
{
scp_session_destroy(session);
log_message(LOG_LEVEL_WARNING,
"[v0:%d] connection aborted: unsupported bpp: %d",
__LINE__, (tui8)sz);
return SCP_SERVER_STATE_INTERNAL_ERR;
}
if (s_check_rem(c->in_s, 2)) if (s_check_rem(c->in_s, 2))
{ {

@ -131,6 +131,14 @@ enum SCP_SERVER_STATES_E scp_v1s_accept(struct SCP_CONNECTION *c, struct SCP_SES
in_uint16_be(c->in_s, cmd); in_uint16_be(c->in_s, cmd);
scp_session_set_height(session, cmd); scp_session_set_height(session, cmd);
in_uint8(c->in_s, sz); in_uint8(c->in_s, sz);
if (0 != scp_session_set_bpp(session, sz))
{
scp_session_destroy(session);
log_message(LOG_LEVEL_WARNING,
"[v1s:%d] connection aborted: unsupported bpp: %d",
__LINE__, sz);
return SCP_SERVER_STATE_INTERNAL_ERR;
}
scp_session_set_bpp(session, sz); scp_session_set_bpp(session, sz);
in_uint8(c->in_s, sz); in_uint8(c->in_s, sz);
scp_session_set_rsr(session, sz); scp_session_set_rsr(session, sz);

@ -993,12 +993,18 @@ lib_mod_connect(struct vnc *v)
v->server_msg(v, "VNC started connecting", 0); v->server_msg(v, "VNC started connecting", 0);
check_sec_result = 1; check_sec_result = 1;
/* only support 8 and 16 bpp connections from rdp client */ /* check if bpp is supported for rdp connection */
if ((v->server_bpp != 8) && (v->server_bpp != 15) && switch (v->server_bpp)
(v->server_bpp != 16) && (v->server_bpp != 24)) {
{ case 8:
v->server_msg(v, "VNC error - only supporting 8, 15, 16 and 24 bpp rdp " case 15:
"connections", 0); case 16:
case 24:
case 32:
break;
default:
v->server_msg(v, "VNC error - only supporting 8, 15, 16, 24 and 32 "
"bpp rdp connections", 0);
return 1; return 1;
} }

Loading…
Cancel
Save