XI: directly write out X_OpenDevice reply
Write out X_OpenDevice 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
4c27b09c53
commit
baac2944f6
|
@ -421,9 +421,7 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
|
||||||
{
|
{
|
||||||
/* All we look at is the type field */
|
/* All we look at is the type field */
|
||||||
/* This is common to all replies */
|
/* This is common to all replies */
|
||||||
if (rep->RepType == X_OpenDevice)
|
if (rep->RepType == X_SetDeviceMode)
|
||||||
SRepXOpenDevice(client, len, (xOpenDeviceReply *) rep);
|
|
||||||
else if (rep->RepType == X_SetDeviceMode)
|
|
||||||
SRepXSetDeviceMode(client, len, (xSetDeviceModeReply *) rep);
|
SRepXSetDeviceMode(client, len, (xSetDeviceModeReply *) rep);
|
||||||
else if (rep->RepType == X_GetSelectedExtensionEvents)
|
else if (rep->RepType == X_GetSelectedExtensionEvents)
|
||||||
SRepXGetSelectedExtensionEvents(client, len,
|
SRepXGetSelectedExtensionEvents(client, len,
|
||||||
|
|
23
Xi/opendev.c
23
Xi/opendev.c
|
@ -137,22 +137,13 @@ ProcXOpenDevice(ClientPtr client)
|
||||||
.length = bytes_to_int32(j * sizeof(xInputClassInfo)),
|
.length = bytes_to_int32(j * sizeof(xInputClassInfo)),
|
||||||
.num_classes = j
|
.num_classes = j
|
||||||
};
|
};
|
||||||
WriteReplyToClient(client, sizeof(xOpenDeviceReply), &rep);
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
WriteToClient(client, sizeof(xOpenDeviceReply), &rep);
|
||||||
WriteToClient(client, j * sizeof(xInputClassInfo), evbase);
|
WriteToClient(client, j * sizeof(xInputClassInfo), evbase);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
*
|
|
||||||
* This procedure writes the reply for the XOpenDevice function,
|
|
||||||
* if the client and server have a different byte ordering.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep)
|
|
||||||
{
|
|
||||||
swaps(&rep->sequenceNumber);
|
|
||||||
swapl(&rep->length);
|
|
||||||
WriteToClient(client, size, rep);
|
|
||||||
}
|
|
||||||
|
|
|
@ -33,9 +33,4 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
int ProcXOpenDevice(ClientPtr /* client */
|
int ProcXOpenDevice(ClientPtr /* client */
|
||||||
);
|
);
|
||||||
|
|
||||||
void SRepXOpenDevice(ClientPtr /* client */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xOpenDeviceReply * /* rep */
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif /* OPENDEV_H */
|
#endif /* OPENDEV_H */
|
||||||
|
|
Loading…
Reference in New Issue