XI: directly write out X_GetExtensionVersion reply
Write out the X_GetExtensionVersion reply directly (and do the swapping within the request handler) instead of going through separate callback that's having demux the replies again. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
62863427a3
commit
be45dd2d06
|
@ -421,10 +421,7 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
|
|||
{
|
||||
/* All we look at is the type field */
|
||||
/* This is common to all replies */
|
||||
if (rep->RepType == X_GetExtensionVersion)
|
||||
SRepXGetExtensionVersion(client, len,
|
||||
(xGetExtensionVersionReply *) rep);
|
||||
else if (rep->RepType == X_ListInputDevices)
|
||||
if (rep->RepType == X_ListInputDevices)
|
||||
SRepXListInputDevices(client, len, (xListInputDevicesReply *) rep);
|
||||
else if (rep->RepType == X_OpenDevice)
|
||||
SRepXOpenDevice(client, len, (xOpenDeviceReply *) rep);
|
||||
|
|
27
Xi/getvers.c
27
Xi/getvers.c
|
@ -103,25 +103,14 @@ ProcXGetExtensionVersion(ClientPtr client)
|
|||
.present = TRUE
|
||||
};
|
||||
|
||||
WriteReplyToClient(client, sizeof(xGetExtensionVersionReply), &rep);
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.major_version);
|
||||
swaps(&rep.minor_version);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(xGetExtensionVersionReply), &rep);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure writes the reply for the XGetExtensionVersion function,
|
||||
* if the client and server have a different byte ordering.
|
||||
*
|
||||
*/
|
||||
|
||||
void _X_COLD
|
||||
SRepXGetExtensionVersion(ClientPtr client, int size,
|
||||
xGetExtensionVersionReply * rep)
|
||||
{
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
swaps(&rep->major_version);
|
||||
swaps(&rep->minor_version);
|
||||
WriteToClient(client, size, rep);
|
||||
}
|
||||
|
|
|
@ -36,9 +36,4 @@ int SProcXGetExtensionVersion(ClientPtr /* client */
|
|||
int ProcXGetExtensionVersion(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void SRepXGetExtensionVersion(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xGetExtensionVersionReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* GETVERS_H */
|
||||
|
|
Loading…
Reference in New Issue