damage: don't block requests when version not requested yet
The original intention was negotiating versions before any further requests can be processed, so requests that might become incompatible in future versions still can be dispatched correctly. But practically that's never been the case: there's just one major version, and it's unlikely that a new *major* version (that might be incompatible with the current one, using same request codes for different things) will come in the forseeable future. So this extra logic isn't practically needed and just complicates dispatching. Dropping it clears the road for further simplification of the dispatcher. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
5e56e15191
commit
579ece670b
|
@ -306,7 +306,7 @@ ProcDamageCreate(ClientPtr client)
|
|||
REQUEST(xDamageCreateReq);
|
||||
REQUEST_SIZE_MATCH(xDamageCreateReq);
|
||||
|
||||
#ifdef PANORAMIX
|
||||
#ifdef XINERAMA
|
||||
if (damageUseXinerama)
|
||||
return PanoramiXDamageCreate(client);
|
||||
#endif
|
||||
|
@ -468,12 +468,6 @@ ProcDamageAdd(ClientPtr client)
|
|||
return Success;
|
||||
}
|
||||
|
||||
/* Major version controls available requests */
|
||||
static const int version_requests[] = {
|
||||
X_DamageQueryVersion, /* before client sends QueryVersion */
|
||||
X_DamageAdd, /* Version 1 */
|
||||
};
|
||||
|
||||
static int (*ProcDamageVector[XDamageNumberRequests]) (ClientPtr) = {
|
||||
/*************** Version 1 ******************/
|
||||
ProcDamageQueryVersion,
|
||||
|
@ -487,14 +481,12 @@ static int (*ProcDamageVector[XDamageNumberRequests]) (ClientPtr) = {
|
|||
static int
|
||||
ProcDamageDispatch(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDamageReq);
|
||||
DamageClientPtr pDamageClient = GetDamageClient(client);
|
||||
REQUEST(xReq);
|
||||
|
||||
if (pDamageClient->major_version >= ARRAY_SIZE(version_requests))
|
||||
if (stuff->data >= ARRAY_SIZE(ProcDamageVector))
|
||||
return BadRequest;
|
||||
if (stuff->damageReqType > version_requests[pDamageClient->major_version])
|
||||
return BadRequest;
|
||||
return (*ProcDamageVector[stuff->damageReqType]) (client);
|
||||
|
||||
return (*ProcDamageVector[stuff->data]) (client);
|
||||
}
|
||||
|
||||
static int _X_COLD
|
||||
|
@ -560,14 +552,12 @@ static int (*SProcDamageVector[XDamageNumberRequests]) (ClientPtr) = {
|
|||
static int _X_COLD
|
||||
SProcDamageDispatch(ClientPtr client)
|
||||
{
|
||||
REQUEST(xDamageReq);
|
||||
DamageClientPtr pDamageClient = GetDamageClient(client);
|
||||
REQUEST(xReq);
|
||||
|
||||
if (pDamageClient->major_version >= ARRAY_SIZE(version_requests))
|
||||
if (stuff->data >= ARRAY_SIZE(ProcDamageVector))
|
||||
return BadRequest;
|
||||
if (stuff->damageReqType > version_requests[pDamageClient->major_version])
|
||||
return BadRequest;
|
||||
return (*SProcDamageVector[stuff->damageReqType]) (client);
|
||||
|
||||
return (*SProcDamageVector[stuff->data]) (client);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in New Issue