From b5cdcfa55c399e83d51242e93d4f25d8bc4fec1f Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 1 Sep 2008 19:45:30 +0200 Subject: Xevie: swap replies as necessary --- Xext/xevie.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'Xext') diff --git a/Xext/xevie.c b/Xext/xevie.c index 8273b3ec2..dfec68fe6 100644 --- a/Xext/xevie.c +++ b/Xext/xevie.c @@ -151,6 +151,7 @@ static int ProcXevieQueryVersion (ClientPtr client) { xXevieQueryVersionReply rep; + int n; REQUEST_SIZE_MATCH (xXevieQueryVersionReq); rep.type = X_Reply; @@ -158,6 +159,12 @@ int ProcXevieQueryVersion (ClientPtr client) rep.sequence_number = client->sequence; rep.server_major_version = XEVIE_MAJOR_VERSION; rep.server_minor_version = XEVIE_MINOR_VERSION; + if (client->swapped) { + swaps(&rep.sequence_number, n); + swapl(&rep.length, n); + swaps(&rep.server_major_version, n); + swaps(&rep.server_minor_version, n); + } WriteToClient (client, sizeof (xXevieQueryVersionReply), (char *)&rep); return client->noClientException; } @@ -166,6 +173,7 @@ static int ProcXevieStart (ClientPtr client) { xXevieStartReply rep; + int n; REQUEST_SIZE_MATCH (xXevieStartReq); rep.pad1 = 0; @@ -200,6 +208,10 @@ int ProcXevieStart (ClientPtr client) rep.length = 0; rep.type = X_Reply; rep.sequence_number = client->sequence; + if (client->swapped) { + swaps(&rep.sequence_number, n); + swapl(&rep.length, n); + } WriteToClient (client, sizeof (xXevieStartReply), (char *)&rep); return client->noClientException; } @@ -208,6 +220,7 @@ static int ProcXevieEnd (ClientPtr client) { xXevieEndReply rep; + int n; REQUEST_SIZE_MATCH (xXevieEndReq); @@ -222,6 +235,10 @@ int ProcXevieEnd (ClientPtr client) rep.length = 0; rep.type = X_Reply; rep.sequence_number = client->sequence; + if (client->swapped) { + swaps(&rep.sequence_number, n); + swapl(&rep.length, n); + } WriteToClient (client, sizeof (xXevieEndReply), (char *)&rep); return client->noClientException; } @@ -233,6 +250,7 @@ int ProcXevieSend (ClientPtr client) xXevieSendReply rep; xEvent *xE; static unsigned char lastDetail = 0, lastType = 0; + int n; REQUEST_SIZE_MATCH (xXevieSendReq); @@ -243,6 +261,10 @@ int ProcXevieSend (ClientPtr client) rep.length = 0; rep.type = X_Reply; rep.sequence_number = client->sequence; + if (client->swapped) { + swaps(&rep.sequence_number, n); + swapl(&rep.length, n); + } WriteToClient (client, sizeof (xXevieSendReply), (char *)&rep); switch(xE->u.u.type) { @@ -280,6 +302,7 @@ int ProcXevieSelectInput (ClientPtr client) { REQUEST (xXevieSelectInputReq); xXevieSelectInputReply rep; + int n; REQUEST_SIZE_MATCH (xXevieSelectInputReq); @@ -290,6 +313,10 @@ int ProcXevieSelectInput (ClientPtr client) rep.length = 0; rep.type = X_Reply; rep.sequence_number = client->sequence; + if (client->swapped) { + swaps(&rep.sequence_number, n); + swapl(&rep.length, n); + } WriteToClient (client, sizeof (xXevieSelectInputReply), (char *)&rep); return client->noClientException; } -- cgit v1.2.3