summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2010-04-15 18:36:55 -0400
committerAdam Jackson <ajax@redhat.com>2011-01-20 21:08:17 -0500
commitcb61cf5c99004ba3c76b504220c6728b5f2d2de6 (patch)
tree948201a5bf99260f8557a8c10be74d379576b903 /dix
parent3282e3c627f97f079e3a9af756a6b13bd9a5f227 (diff)
resource: Remove expectID hack
This is clearly meant to short-circuit the (modestly) expensive resource lookup in LegalNewID. The problem is that long-lived clients will eventually run completely through their XID space and start asking XC-MISC for IDs to reuse. Once that happens, the comparison against expectID will always be true, and we'll no longer catch XID collisions at all. Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'dix')
-rw-r--r--dix/resource.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/dix/resource.c b/dix/resource.c
index 18ed68223..f558ed27f 100644
--- a/dix/resource.c
+++ b/dix/resource.c
@@ -175,7 +175,6 @@ typedef struct _ClientResource {
int hashsize; /* log(2)(buckets) */
XID fakeID;
XID endFakeID;
- XID expectID;
} ClientResourceRec;
RESTYPE lastResourceType;
@@ -322,7 +321,6 @@ InitClientResources(ClientPtr client)
clientTable[i].fakeID = client->clientAsMask |
(client->index ? SERVER_BIT : SERVER_MINID);
clientTable[i].endFakeID = (clientTable[i].fakeID | RESOURCE_ID_MASK) + 1;
- clientTable[i].expectID = client->clientAsMask;
for (j=0; j<INITBUCKETS; j++)
{
clientTable[i].resources[j] = NULL;
@@ -511,8 +509,6 @@ AddResource(XID id, RESTYPE type, pointer value)
res->value = value;
*head = res;
rrec->elements++;
- if (!(id & SERVER_BIT) && (id >= rrec->expectID))
- rrec->expectID = id + 1;
CallResourceStateCallback(ResourceStateAdding, res);
return TRUE;
}
@@ -895,9 +891,6 @@ LegalNewID(XID id, ClientPtr client)
#endif /* PANORAMIX */
if (client->clientAsMask == (id & ~RESOURCE_ID_MASK))
{
- if (clientTable[client->index].expectID <= id)
- return TRUE;
-
rc = dixLookupResourceByClass(&val, id, RC_ANY, serverClient,
DixGetAttrAccess);
return rc == BadValue;