diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-09-18 16:27:54 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-09-21 21:47:35 +1000 |
commit | 55747d256d759850141e4a9c4dec965616a31dc8 (patch) | |
tree | b9f140d3bbca93f3028cf2340271789fd1d92e6d /Xext | |
parent | 0b7c6c728c2e2d8433a188315cc591308a89cd85 (diff) |
input: define server-supported protocol versions in one single file.
include/protocol-versions.h specifies each extension version as supported by
the server and sent back on the wire to the client.
This fixes up several issues with the server potentially reporting a higher
version of the protocol if recompiled against a newer version of the
protocol.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: RĂ©mi Cardona <remi@gentoo.org>
Acked-by: Julien Cristau <jcristau@debian.org>
Diffstat (limited to 'Xext')
-rw-r--r-- | Xext/geext.c | 9 | ||||
-rw-r--r-- | Xext/panoramiX.c | 4 | ||||
-rw-r--r-- | Xext/saver.c | 5 | ||||
-rw-r--r-- | Xext/security.c | 5 | ||||
-rw-r--r-- | Xext/shape.c | 5 | ||||
-rw-r--r-- | Xext/shm.c | 5 | ||||
-rw-r--r-- | Xext/xcalibrate.c | 5 | ||||
-rw-r--r-- | Xext/xf86bigfont.c | 5 | ||||
-rw-r--r-- | Xext/xres.c | 5 | ||||
-rw-r--r-- | Xext/xvmc.c | 5 |
10 files changed, 28 insertions, 25 deletions
diff --git a/Xext/geext.c b/Xext/geext.c index 1ddcbb1f6..6fad4aec0 100644 --- a/Xext/geext.c +++ b/Xext/geext.c @@ -32,10 +32,7 @@ #include "geint.h" #include "geext.h" - -/* Currently supported XGE version */ -#define SERVER_GE_MAJOR 1 -#define SERVER_GE_MINOR 0 +#include "protocol-versions.h" #define rClient(obj) (clients[CLIENT_ID((obj)->resource)]) @@ -81,8 +78,8 @@ ProcGEQueryVersion(ClientPtr client) rep.sequenceNumber = client->sequence; /* return the supported version by the server */ - rep.majorVersion = SERVER_GE_MAJOR; - rep.minorVersion = SERVER_GE_MINOR; + rep.majorVersion = SERVER_GE_MAJOR_VERSION; + rep.minorVersion = SERVER_GE_MINOR_VERSION; /* Remember version the client requested */ pGEClient->major_version = stuff->majorVersion; diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index c5fb70061..4b7b07e1d 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -56,9 +56,7 @@ Equipment Corporation. #include "picturestr.h" #endif #include "modinit.h" - -#define SERVER_PANORAMIX_MAJOR_VERSION 1 -#define SERVER_PANORAMIX_MINOR_VERSION 1 +#include "protocol-versions.h" #ifdef GLXPROXY extern VisualPtr glxMatchVisual(ScreenPtr pScreen, diff --git a/Xext/saver.c b/Xext/saver.c index 18de4b540..04e6497bd 100644 --- a/Xext/saver.c +++ b/Xext/saver.c @@ -54,6 +54,7 @@ in this Software without prior written authorization from the X Consortium. #ifdef DPMSExtension #include <X11/extensions/dpmsconst.h> #endif +#include "protocol-versions.h" #include <stdio.h> @@ -727,8 +728,8 @@ ProcScreenSaverQueryVersion (ClientPtr client) rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; - rep.majorVersion = ScreenSaverMajorVersion; - rep.minorVersion = ScreenSaverMinorVersion; + rep.majorVersion = SERVER_SAVER_MAJOR_VERSION; + rep.minorVersion = SERVER_SAVER_MINOR_VERSION; if (client->swapped) { swaps(&rep.sequenceNumber, n); swapl(&rep.length, n); diff --git a/Xext/security.c b/Xext/security.c index 42eb9f01d..2cd0e1774 100644 --- a/Xext/security.c +++ b/Xext/security.c @@ -39,6 +39,7 @@ in this Software without prior written authorization from The Open Group. #include "securitysrv.h" #include <X11/extensions/securproto.h> #include "modinit.h" +#include "protocol-versions.h" /* Extension stuff */ static int SecurityErrorBase; /* first Security error number */ @@ -371,8 +372,8 @@ ProcSecurityQueryVersion( rep.type = X_Reply; rep.sequenceNumber = client->sequence; rep.length = 0; - rep.majorVersion = SECURITY_MAJOR_VERSION; - rep.minorVersion = SECURITY_MINOR_VERSION; + rep.majorVersion = SERVER_SECURITY_MAJOR_VERSION; + rep.minorVersion = SERVER_SECURITY_MINOR_VERSION; if(client->swapped) { char n; diff --git a/Xext/shape.c b/Xext/shape.c index 53167d140..700fe76d1 100644 --- a/Xext/shape.c +++ b/Xext/shape.c @@ -45,6 +45,7 @@ in this Software without prior written authorization from The Open Group. #include "regionstr.h" #include "gcstruct.h" #include "modinit.h" +#include "protocol-versions.h" typedef RegionPtr (*CreateDftPtr)( WindowPtr /* pWin */ @@ -259,8 +260,8 @@ ProcShapeQueryVersion (ClientPtr client) rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; - rep.majorVersion = SHAPE_MAJOR_VERSION; - rep.minorVersion = SHAPE_MINOR_VERSION; + rep.majorVersion = SERVER_SHAPE_MAJOR_VERSION; + rep.minorVersion = SERVER_SHAPE_MINOR_VERSION; if (client->swapped) { swaps(&rep.sequenceNumber, n); swapl(&rep.length, n); diff --git a/Xext/shm.c b/Xext/shm.c index dd097e605..e4f08e2a2 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -54,6 +54,7 @@ in this Software without prior written authorization from The Open Group. #include "xace.h" #include <X11/extensions/shmproto.h> #include <X11/Xfuncproto.h> +#include "protocol-versions.h" /* Needed for Solaris cross-zone shared memory extension */ #ifdef HAVE_SHMCTL64 @@ -313,8 +314,8 @@ ProcShmQueryVersion(ClientPtr client) rep.sequenceNumber = client->sequence; rep.sharedPixmaps = sharedPixmaps; rep.pixmapFormat = sharedPixmaps ? ZPixmap : 0; - rep.majorVersion = SHM_MAJOR_VERSION; - rep.minorVersion = SHM_MINOR_VERSION; + rep.majorVersion = SERVER_SHM_MAJOR_VERSION; + rep.minorVersion = SERVER_SHM_MINOR_VERSION; rep.uid = geteuid(); rep.gid = getegid(); if (client->swapped) { diff --git a/Xext/xcalibrate.c b/Xext/xcalibrate.c index f923c17a1..6e6461a5f 100644 --- a/Xext/xcalibrate.c +++ b/Xext/xcalibrate.c @@ -32,6 +32,7 @@ #include "dixstruct.h" #include "extnsionst.h" #include "swaprep.h" +#include "protocol-versions.h" #include <X11/extensions/xcalibrateproto.h> #include <X11/extensions/xcalibratewire.h> @@ -79,8 +80,8 @@ ProcXCalibrateQueryVersion (ClientPtr client) rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; - rep.majorVersion = XCALIBRATE_MAJOR_VERSION; - rep.minorVersion = XCALIBRATE_MINOR_VERSION; + rep.majorVersion = SERVER_XCALIBRATE_MAJOR_VERSION; + rep.minorVersion = SERVER_XCALIBRATE_MINOR_VERSION; if (client->swapped) { int n; swaps(&rep.sequenceNumber, n); diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c index aeea23313..ba8b60358 100644 --- a/Xext/xf86bigfont.c +++ b/Xext/xf86bigfont.c @@ -71,6 +71,7 @@ #include "gcstruct.h" #include "dixfontstr.h" #include "extnsionst.h" +#include "protocol-versions.h" #include <X11/extensions/xf86bigfproto.h> @@ -338,8 +339,8 @@ ProcXF86BigfontQueryVersion( reply.type = X_Reply; reply.length = 0; reply.sequenceNumber = client->sequence; - reply.majorVersion = XF86BIGFONT_MAJOR_VERSION; - reply.minorVersion = XF86BIGFONT_MINOR_VERSION; + reply.majorVersion = SERVER_XF86BIGFONT_MAJOR_VERSION; + reply.minorVersion = SERVER_XF86BIGFONT_MINOR_VERSION; reply.uid = geteuid(); reply.gid = getegid(); #ifdef HAS_SHM diff --git a/Xext/xres.c b/Xext/xres.c index 9dd08b113..109aa639a 100644 --- a/Xext/xres.c +++ b/Xext/xres.c @@ -21,6 +21,7 @@ #include "windowstr.h" #include "gcstruct.h" #include "modinit.h" +#include "protocol-versions.h" static int ProcXResQueryVersion (ClientPtr client) @@ -39,8 +40,8 @@ ProcXResQueryVersion (ClientPtr client) rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; - rep.server_major = XRES_MAJOR_VERSION; - rep.server_minor = XRES_MINOR_VERSION; + rep.server_major = SERVER_XRES_MAJOR_VERSION; + rep.server_minor = SERVER_XRES_MINOR_VERSION; if (client->swapped) { int n; swaps(&rep.sequenceNumber, n); diff --git a/Xext/xvmc.c b/Xext/xvmc.c index b7bb0fc1b..c17a4b1c3 100644 --- a/Xext/xvmc.c +++ b/Xext/xvmc.c @@ -20,6 +20,7 @@ #include <X11/extensions/Xvproto.h> #include <X11/extensions/XvMCproto.h> #include "xvmcext.h" +#include "protocol-versions.h" #ifdef HAS_XVMCSHM #include <sys/ipc.h> @@ -116,8 +117,8 @@ ProcXvMCQueryVersion(ClientPtr client) rep.type = X_Reply; rep.sequenceNumber = client->sequence; rep.length = 0; - rep.major = XvMCVersion; - rep.minor = XvMCRevision; + rep.major = SERVER_XVMC_MAJOR_VERSION; + rep.minor = SERVER_XVMC_MINOR_VERSION; WriteToClient(client, sizeof(xvmcQueryVersionReply), (char*)&rep); return Success; } |