summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Xext/xevie.c27
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;
}