dix: write out X_InternAtom reply directly
No need for using a complex callback machinery, if we just move the little pieces of byte-swapping directly into the request handler. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
9541233f8d
commit
56f1c26056
|
@ -1090,18 +1090,22 @@ ProcInternAtom(ClientPtr client)
|
||||||
}
|
}
|
||||||
tchar = (char *) &stuff[1];
|
tchar = (char *) &stuff[1];
|
||||||
atom = MakeAtom(tchar, stuff->nbytes, !stuff->onlyIfExists);
|
atom = MakeAtom(tchar, stuff->nbytes, !stuff->onlyIfExists);
|
||||||
if (atom != BAD_RESOURCE) {
|
if (atom == BAD_RESOURCE)
|
||||||
xInternAtomReply reply = {
|
|
||||||
.type = X_Reply,
|
|
||||||
.sequenceNumber = client->sequence,
|
|
||||||
.length = 0,
|
|
||||||
.atom = atom
|
|
||||||
};
|
|
||||||
WriteReplyToClient(client, sizeof(xInternAtomReply), &reply);
|
|
||||||
return Success;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
|
xInternAtomReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
.atom = atom
|
||||||
|
};
|
||||||
|
|
||||||
|
if (client->swapped) {
|
||||||
|
swaps(&rep.sequenceNumber);
|
||||||
|
swapl(&rep.atom);
|
||||||
|
}
|
||||||
|
WriteToClient(client, sizeof(rep), &rep);
|
||||||
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -183,14 +183,6 @@ SGenericReply(ClientPtr pClient, int size, xGenericReply * pRep)
|
||||||
WriteToClient(pClient, size, pRep);
|
WriteToClient(pClient, size, pRep);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _X_COLD
|
|
||||||
SInternAtomReply(ClientPtr pClient, int size, xInternAtomReply * pRep)
|
|
||||||
{
|
|
||||||
swaps(&pRep->sequenceNumber);
|
|
||||||
swapl(&pRep->atom);
|
|
||||||
WriteToClient(pClient, size, pRep);
|
|
||||||
}
|
|
||||||
|
|
||||||
void _X_COLD
|
void _X_COLD
|
||||||
SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply * pRep)
|
SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply * pRep)
|
||||||
{
|
{
|
||||||
|
|
|
@ -731,7 +731,7 @@ ReplySwapPtr ReplySwapVector[256] = {
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd, /* 15 */
|
ReplyNotSwappd, /* 15 */
|
||||||
(ReplySwapPtr) SInternAtomReply,
|
ReplyNotSwappd,
|
||||||
(ReplySwapPtr) SGetAtomNameReply,
|
(ReplySwapPtr) SGetAtomNameReply,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
ReplyNotSwappd,
|
ReplyNotSwappd,
|
||||||
|
|
|
@ -42,10 +42,6 @@ extern void SGenericReply(ClientPtr /* pClient */ ,
|
||||||
int /* size */ ,
|
int /* size */ ,
|
||||||
xGenericReply * /* pRep */ );
|
xGenericReply * /* pRep */ );
|
||||||
|
|
||||||
extern void SInternAtomReply(ClientPtr /* pClient */ ,
|
|
||||||
int /* size */ ,
|
|
||||||
xInternAtomReply * /* pRep */ );
|
|
||||||
|
|
||||||
extern void SGetAtomNameReply(ClientPtr /* pClient */ ,
|
extern void SGetAtomNameReply(ClientPtr /* pClient */ ,
|
||||||
int /* size */ ,
|
int /* size */ ,
|
||||||
xGetAtomNameReply * /* pRep */ );
|
xGetAtomNameReply * /* pRep */ );
|
||||||
|
|
Loading…
Reference in New Issue