XI: directly write out X_ListInputDevices reply
Write out X_ListInputDevices the 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
be45dd2d06
commit
4c27b09c53
|
@ -421,9 +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_ListInputDevices)
|
||||
SRepXListInputDevices(client, len, (xListInputDevicesReply *) rep);
|
||||
else if (rep->RepType == X_OpenDevice)
|
||||
if (rep->RepType == X_OpenDevice)
|
||||
SRepXOpenDevice(client, len, (xOpenDeviceReply *) rep);
|
||||
else if (rep->RepType == X_SetDeviceMode)
|
||||
SRepXSetDeviceMode(client, len, (xSetDeviceModeReply *) rep);
|
||||
|
|
23
Xi/listdev.c
23
Xi/listdev.c
|
@ -384,24 +384,15 @@ ProcXListInputDevices(ClientPtr client)
|
|||
}
|
||||
rep.ndevices = numdevs;
|
||||
rep.length = bytes_to_int32(total_length);
|
||||
WriteReplyToClient(client, sizeof(xListInputDevicesReply), &rep);
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(xListInputDevicesReply), &rep);
|
||||
WriteToClient(client, total_length, savbuf);
|
||||
free(savbuf);
|
||||
free(skip);
|
||||
return Success;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* This procedure writes the reply for the XListInputDevices function,
|
||||
* if the client and server have a different byte ordering.
|
||||
*
|
||||
*/
|
||||
|
||||
void _X_COLD
|
||||
SRepXListInputDevices(ClientPtr client, int size, xListInputDevicesReply * rep)
|
||||
{
|
||||
swaps(&rep->sequenceNumber);
|
||||
swapl(&rep->length);
|
||||
WriteToClient(client, size, rep);
|
||||
}
|
||||
|
|
|
@ -35,9 +35,4 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
int ProcXListInputDevices(ClientPtr /* client */
|
||||
);
|
||||
|
||||
void SRepXListInputDevices(ClientPtr /* client */ ,
|
||||
int /* size */ ,
|
||||
xListInputDevicesReply * /* rep */
|
||||
);
|
||||
|
||||
#endif /* LISTDEV_H */
|
||||
|
|
Loading…
Reference in New Issue