diff options
author | Julien Cristau <jcristau@debian.org> | 2008-09-01 19:45:30 +0200 |
---|---|---|
committer | Julien Cristau <jcristau@debian.org> | 2008-09-01 20:05:05 +0200 |
commit | b5cdcfa55c399e83d51242e93d4f25d8bc4fec1f (patch) | |
tree | 6c7be9a76802f91c82afd8d36f40b02525a7a3d6 | |
parent | d3ae193f4ac87530f2745f8cb5e7b70dd516881e (diff) |
Xevie: swap replies as necessary
-rw-r--r-- | Xext/xevie.c | 27 |
1 files changed, 27 insertions, 0 deletions
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; } |