diff options
author | Joel Bosveld <joel.bosveld@gmail.com> | 2009-09-08 23:06:00 +0800 |
---|---|---|
committer | Joel Bosveld <joel.bosveld@gmail.com> | 2009-09-08 23:55:13 +0800 |
commit | 1ba17340a98a34b40f78442963aa4132e6cfae5c (patch) | |
tree | d11d814844e4ad037d146133250b73f28cdb3e31 /record | |
parent | 5e38708c3466129c3e5af40a915c044bb26e083f (diff) | |
parent | 1bdc9ec617d357b076c9e69296018bc212d91c7d (diff) |
Conflicts:
test/Makefile.am
Diffstat (limited to 'record')
-rw-r--r-- | record/record.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/record/record.c b/record/record.c index 3c4bb9ecb..84a96188a 100644 --- a/record/record.c +++ b/record/record.c @@ -38,8 +38,7 @@ and Jim Haggerty of Metheus. #include "dixstruct.h" #include "extnsionst.h" -#define _XRECORD_SERVER_ -#include <X11/extensions/recordstr.h> +#include <X11/extensions/recordproto.h> #include "set.h" #include "swaprep.h" #include "inputstr.h" @@ -372,7 +371,8 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient, replylen = pRep->length; if (recordingClientSwapped) swapl(&replylen, n); - replylen += numElemHeaders + (datalen >> 2) + (futurelen >> 2); + replylen += numElemHeaders + bytes_to_int32(datalen) + + bytes_to_int32(futurelen); if (recordingClientSwapped) swapl(&replylen, n); pRep->length = replylen; } /* end if not continued reply */ @@ -480,7 +480,7 @@ RecordABigRequest(RecordContextPtr pContext, ClientPtr client, xReq *stuff) (pointer)stuff, SIZEOF(xReq), bytesLeft); /* reinsert the extended length field that was squished out */ - bigLength = client->req_len + (sizeof(bigLength) >> 2); + bigLength = client->req_len + bytes_to_int32(sizeof(bigLength)); if (client->swapped) swapl(&bigLength, n); RecordAProtocolElement(pContext, client, XRecordFromClient, @@ -613,7 +613,7 @@ RecordAReply(CallbackListPtr *pcbl, pointer nulldata, pointer calldata) if (pContext->continuedReply) { RecordAProtocolElement(pContext, client, XRecordFromServer, - pri->replyData, pri->dataLenBytes, /* continuation */ -1); + (pointer)pri->replyData, pri->dataLenBytes, /* continuation */ -1); if (!pri->bytesRemaining) pContext->continuedReply = 0; } @@ -623,7 +623,7 @@ RecordAReply(CallbackListPtr *pcbl, pointer nulldata, pointer calldata) if (majorop <= 127) { /* core reply */ RecordAProtocolElement(pContext, client, XRecordFromServer, - pri->replyData, pri->dataLenBytes, pri->bytesRemaining); + (pointer)pri->replyData, pri->dataLenBytes, pri->bytesRemaining); if (pri->bytesRemaining) pContext->continuedReply = 1; } @@ -644,7 +644,7 @@ RecordAReply(CallbackListPtr *pcbl, pointer nulldata, pointer calldata) minorop)) { RecordAProtocolElement(pContext, client, - XRecordFromServer, pri->replyData, + XRecordFromServer, (pointer)pri->replyData, pri->dataLenBytes, pri->bytesRemaining); if (pri->bytesRemaining) pContext->continuedReply = 1; @@ -2279,8 +2279,8 @@ ProcRecordGetContext(ClientPtr client) { rep.nClients += pRCAP->numClients; rep.length += pRCAP->numClients * - ( (sizeof(xRecordClientInfo) >> 2) + - pri->nRanges * (sizeof(xRecordRange) >> 2)); + ( bytes_to_int32(sizeof(xRecordClientInfo)) + + pri->nRanges * bytes_to_int32(sizeof(xRecordRange))); } /* write the reply header */ @@ -2579,13 +2579,13 @@ SwapCreateRegister(xRecordRegisterClientsReq *stuff) swapl(&stuff->nClients, n); swapl(&stuff->nRanges, n); pClientID = (XID *)&stuff[1]; - if (stuff->nClients > stuff->length - (sz_xRecordRegisterClientsReq >> 2)) + if (stuff->nClients > stuff->length - bytes_to_int32(sz_xRecordRegisterClientsReq)) return BadLength; for (i = 0; i < stuff->nClients; i++, pClientID++) { swapl(pClientID, n); } - if (stuff->nRanges > stuff->length - (sz_xRecordRegisterClientsReq >> 2) + if (stuff->nRanges > stuff->length - bytes_to_int32(sz_xRecordRegisterClientsReq) - stuff->nClients) return BadLength; RecordSwapRanges((xRecordRange *)pClientID, stuff->nRanges); @@ -2740,8 +2740,8 @@ RecordConnectionSetupInfo(RecordContextPtr pContext, NewClientInfoRec *pci) char *pConnSetup = (char *)xalloc(prefixsize + restsize); if (!pConnSetup) return; - SwapConnSetupPrefix(pci->prefix, pConnSetup); - SwapConnSetupInfo(pci->setup, pConnSetup + prefixsize); + SwapConnSetupPrefix(pci->prefix, (xConnSetupPrefix*)pConnSetup); + SwapConnSetupInfo((char*)pci->setup, (char*)(pConnSetup + prefixsize)); RecordAProtocolElement(pContext, pci->client, XRecordClientStarted, (pointer)pConnSetup, prefixsize + restsize, 0); xfree(pConnSetup); @@ -2864,6 +2864,13 @@ RecordCloseDown(ExtensionEntry *extEntry) void RecordExtensionInit(void) { + /* FIXME Record is currently broken. Dont initialize it so that clients + * that require it can bail out correctly rather than waiting for stuff + * that'll never happen */ + ErrorF("record: RECORD extension enabled at configure time.\n"); + ErrorF("record: This extension is known to be broken, disabling extension now..\n"); + ErrorF("record: http://bugs.freedesktop.org/show_bug.cgi?id=20500\n"); +#if 0 ExtensionEntry *extentry; RTContext = CreateNewResourceType(RecordDeleteContext); @@ -2886,5 +2893,6 @@ RecordExtensionInit(void) } RecordErrorBase = extentry->errorBase; +#endif } /* RecordExtensionInit */ |