XI: directly write out X_GetDeviceControl reply
Write out the X_GetDeviceControl 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
							
								
									3ff2fd4d32
								
							
						
					
					
						commit
						ffb75fee3f
					
				|  | @ -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_GetDeviceControl) | ||||
|         SRepXGetDeviceControl(client, len, (xGetDeviceControlReply *) rep); | ||||
|     else if (rep->RepType == X_ChangeDeviceControl) | ||||
|     if (rep->RepType == X_ChangeDeviceControl) | ||||
|         SRepXChangeDeviceControl(client, len, | ||||
|                                  (xChangeDeviceControlReply *) rep); | ||||
|     else if (rep->RepType == X_ListDeviceProperties) | ||||
|  |  | |||
							
								
								
									
										21
									
								
								Xi/getdctl.c
								
								
								
								
							
							
						
						
									
										21
									
								
								Xi/getdctl.c
								
								
								
								
							|  | @ -143,21 +143,6 @@ CopySwapDeviceEnable(ClientPtr client, DeviceIntPtr dev, char *buf) | |||
|     } | ||||
| } | ||||
| 
 | ||||
| /***********************************************************************
 | ||||
|  * | ||||
|  * This procedure writes the reply for the xGetDeviceControl function, | ||||
|  * if the client and server have a different byte ordering. | ||||
|  * | ||||
|  */ | ||||
| 
 | ||||
| void _X_COLD | ||||
| SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep) | ||||
| { | ||||
|     swaps(&rep->sequenceNumber); | ||||
|     swapl(&rep->length); | ||||
|     WriteToClient(client, size, rep); | ||||
| } | ||||
| 
 | ||||
| /***********************************************************************
 | ||||
|  * | ||||
|  * Get the state of the specified device control. | ||||
|  | @ -224,7 +209,11 @@ ProcXGetDeviceControl(ClientPtr client) | |||
|         .length = bytes_to_int32(total_length), | ||||
|     }; | ||||
| 
 | ||||
|     WriteReplyToClient(client, sizeof(xGetDeviceControlReply), &rep); | ||||
|     if (client->swapped) { | ||||
|         swaps(&rep.sequenceNumber); | ||||
|         swapl(&rep.length); | ||||
|     } | ||||
|     WriteToClient(client, sizeof(xGetDeviceControlReply), &rep); | ||||
|     WriteToClient(client, total_length, savbuf); | ||||
|     free(savbuf); | ||||
|     return Success; | ||||
|  |  | |||
|  | @ -36,9 +36,4 @@ int SProcXGetDeviceControl(ClientPtr    /* client */ | |||
| int ProcXGetDeviceControl(ClientPtr     /* client */ | ||||
|     ); | ||||
| 
 | ||||
| void SRepXGetDeviceControl(ClientPtr /* client */ , | ||||
|                            int /* size */ , | ||||
|                            xGetDeviceControlReply *     /* rep */ | ||||
|     ); | ||||
| 
 | ||||
| #endif                          /* GETDCTL_H */ | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue