XI: directly write out X_XIQueryVersion reply
Write out the X_XIQueryVersion reply directly (and do the swapping within the request handler) instead of going through separate callback that's having demux the replies again. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
		
							parent
							
								
									e916ae88bc
								
							
						
					
					
						commit
						34b0377bc7
					
				|  | @ -421,9 +421,7 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep) | |||
| { | ||||
|     /* All we look at is the type field */ | ||||
|     /* This is common to all replies    */ | ||||
|     if (rep->RepType == X_XIQueryVersion) | ||||
|         SRepXIQueryVersion(client, len, (xXIQueryVersionReply *) rep); | ||||
|     else if (rep->RepType == X_XIQueryDevice) | ||||
|     if (rep->RepType == X_XIQueryDevice) | ||||
|         SRepXIQueryDevice(client, len, (xXIQueryDeviceReply *) rep); | ||||
|     else if (rep->RepType == X_XIGrabDevice) | ||||
|         SRepXIGrabDevice(client, len, (xXIGrabDeviceReply *) rep); | ||||
|  |  | |||
|  | @ -116,12 +116,16 @@ ProcXIQueryVersion(ClientPtr client) | |||
|         .repType = X_Reply, | ||||
|         .RepType = X_XIQueryVersion, | ||||
|         .sequenceNumber = client->sequence, | ||||
|         .length = 0, | ||||
|         .major_version = major, | ||||
|         .minor_version = minor | ||||
|     }; | ||||
| 
 | ||||
|     WriteReplyToClient(client, sizeof(xXIQueryVersionReply), &rep); | ||||
|     if (client->swapped) { | ||||
|         swaps(&rep.sequenceNumber); | ||||
|         swaps(&rep.major_version); | ||||
|         swaps(&rep.minor_version); | ||||
|     } | ||||
|     WriteToClient(client, sizeof(xXIQueryVersionReply), &rep); | ||||
| 
 | ||||
|     return Success; | ||||
| } | ||||
|  | @ -137,13 +141,3 @@ SProcXIQueryVersion(ClientPtr client) | |||
|     swaps(&stuff->minor_version); | ||||
|     return (ProcXIQueryVersion(client)); | ||||
| } | ||||
| 
 | ||||
| void _X_COLD | ||||
| SRepXIQueryVersion(ClientPtr client, int size, xXIQueryVersionReply * rep) | ||||
| { | ||||
|     swaps(&rep->sequenceNumber); | ||||
|     swapl(&rep->length); | ||||
|     swaps(&rep->major_version); | ||||
|     swaps(&rep->minor_version); | ||||
|     WriteToClient(client, size, rep); | ||||
| } | ||||
|  |  | |||
|  | @ -35,6 +35,5 @@ | |||
| 
 | ||||
| int SProcXIQueryVersion(ClientPtr client); | ||||
| int ProcXIQueryVersion(ClientPtr client); | ||||
| void SRepXIQueryVersion(ClientPtr client, int size, xXIQueryVersionReply * rep); | ||||
| 
 | ||||
| #endif                          /* QUERYVERSION_H */ | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue