glx: glxcmds: use rpcbuf to build xGLXGetDrawableAttributesReply payload

Signed-off-by: sesankm <26676400+sesankm@users.noreply.github.com>
This commit is contained in:
sesankm
2025-09-23 14:26:30 -05:00
committed by Enrico Weigelt
parent 9d6094442a
commit 79d092cfb9

View File

@@ -1886,28 +1886,17 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
#undef ATTRIB
xGLXGetDrawableAttributesReply reply = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = num << 1,
.numAttribs = num
};
if (client->swapped) {
int length = reply.length;
swaps(&reply.sequenceNumber);
swapl(&reply.length);
swapl(&reply.numAttribs);
WriteToClient(client, sizeof(xGLXGetDrawableAttributesReply), &reply);
SwapLongs(attributes, length);
WriteToClient(client, length << 2, attributes);
}
else {
WriteToClient(client, sizeof(xGLXGetDrawableAttributesReply), &reply);
WriteToClient(client, reply.length * sizeof(CARD32), attributes);
}
return Success;
x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE };
x_rpcbuf_write_CARD32s(&rpcbuf, attributes, num << 1);
return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf);
}
int