From 2b145ba81d4f7ee85428097bd94e8e67159bcbf2 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Thu, 6 Aug 2009 23:33:10 -0700 Subject: [PATCH] Bigreqs are built-in and mandatory. (cherry picked from commit f65c50c4e902c7b5619fb7bbee8462434d809ec7) --- Xext/Makefile.am | 2 +- hw/xfree86/dixmods/extmod/modinit.c | 9 --------- hw/xfree86/dixmods/extmod/modinit.h | 5 ----- hw/xfree86/loader/dixsym.c | 5 ----- include/globals.h | 4 ---- mi/miinitext.c | 13 ++----------- os/io.c | 20 -------------------- os/utils.c | 3 --- 8 files changed, 3 insertions(+), 58 deletions(-) diff --git a/Xext/Makefile.am b/Xext/Makefile.am index 6374bdce0..7eaf2402b 100644 --- a/Xext/Makefile.am +++ b/Xext/Makefile.am @@ -20,6 +20,7 @@ endif # Sources always included in libXextbuiltin.la & libXext.la BUILTIN_SRCS = \ + bigreq.c \ shape.c \ sleepuntil.c \ sleepuntil.h \ @@ -27,7 +28,6 @@ BUILTIN_SRCS = \ # Sources always included in libXextmodule.la & libXext.la MODULE_SRCS = \ - bigreq.c \ shape.c \ sync.c \ xcmisc.c diff --git a/hw/xfree86/dixmods/extmod/modinit.c b/hw/xfree86/dixmods/extmod/modinit.c index a18118a53..cc5888ad8 100644 --- a/hw/xfree86/dixmods/extmod/modinit.c +++ b/hw/xfree86/dixmods/extmod/modinit.c @@ -74,15 +74,6 @@ static ExtensionModule extensionModules[] = { NULL }, #endif -#ifdef BIGREQS - { - BigReqExtensionInit, - XBigReqExtensionName, - &noBigReqExtension, - NULL, - NULL - }, -#endif #ifdef XSYNC { SyncExtensionInit, diff --git a/hw/xfree86/dixmods/extmod/modinit.h b/hw/xfree86/dixmods/extmod/modinit.h index fe95c4922..9ebcf00da 100644 --- a/hw/xfree86/dixmods/extmod/modinit.h +++ b/hw/xfree86/dixmods/extmod/modinit.h @@ -29,11 +29,6 @@ extern void XTestExtensionInit(INITARGS); extern void XTestExtension1Init(INITARGS); #endif -#ifdef BIGREQS -extern void BigReqExtensionInit(INITARGS); -#include -#endif - #ifdef XSYNC extern void SyncExtensionInit(INITARGS); #define _SYNC_SERVER diff --git a/hw/xfree86/loader/dixsym.c b/hw/xfree86/loader/dixsym.c index ef909d6c7..2736cd450 100644 --- a/hw/xfree86/loader/dixsym.c +++ b/hw/xfree86/loader/dixsym.c @@ -226,8 +226,6 @@ _X_HIDDEN void *dixLookupTab[] = { SYMVAR(DPMSDisabledSwitch) SYMVAR(defaultDPMSEnabled) #endif - /* bigreq */ - SYMVAR(maxBigRequestSize) #ifdef XV /* XXX These are exported from the DDX, not DIX. */ SYMVAR(XvScreenInitProc) @@ -341,9 +339,6 @@ _X_HIDDEN void *dixLookupTab[] = { SYMVAR(noTestExtensions) SYMFUNC(GiveUp) -#ifdef BIGREQS - SYMVAR(noBigReqExtension) -#endif #ifdef COMPOSITE SYMVAR(noCompositeExtension) #endif diff --git a/include/globals.h b/include/globals.h index 0d29e02ca..1f2d909df 100644 --- a/include/globals.h +++ b/include/globals.h @@ -46,10 +46,6 @@ extern Bool DPMSCapableFlag; extern Bool PanoramiXExtensionDisabledHack; #endif -#ifdef BIGREQS -extern Bool noBigReqExtension; -#endif - #ifdef COMPOSITE extern Bool noCompositeExtension; #endif diff --git a/mi/miinitext.c b/mi/miinitext.c index 2ce96c3b8..5b35c0414 100644 --- a/mi/miinitext.c +++ b/mi/miinitext.c @@ -88,9 +88,6 @@ SOFTWARE. extern Bool noTestExtensions; -#ifdef BIGREQS -extern Bool noBigReqExtension; -#endif #ifdef COMPOSITE extern Bool noCompositeExtension; #endif @@ -228,9 +225,7 @@ extern void XInputExtensionInit(INITARGS); #ifdef XTEST extern void XTestExtensionInit(INITARGS); #endif -#ifdef BIGREQS extern void BigReqExtensionInit(INITARGS); -#endif #ifdef XIDLE extern void XIdleExtensionInit(INITARGS); #endif @@ -322,9 +317,6 @@ typedef struct { static ExtensionToggle ExtensionToggleList[] = { /* sort order is extension name string as shown in xdpyinfo */ -#ifdef BIGREQS - { "BIG-REQUESTS", &noBigReqExtension }, -#endif #ifdef COMPOSITE { "Composite", &noCompositeExtension }, #endif @@ -463,9 +455,7 @@ InitExtensions(argc, argv) #ifdef XTEST if (!noTestExtensions) XTestExtensionInit(); #endif -#ifdef BIGREQS - if (!noBigReqExtension) BigReqExtensionInit(); -#endif + BigReqExtensionInit(); #ifdef XIDLE if (!noXIdleExtension) XIdleExtensionInit(); #endif @@ -570,6 +560,7 @@ static ExtensionModule staticExtensions[] = { #ifdef XTEST { XTestExtensionInit, XTestExtensionName, &noTestExtensions, NULL, NULL }, #endif + { BigReqExtensionInit, "BIG-REQUESTS", NULL, NULL, NULL }, #ifdef XIDLE { XIdleExtensionInit, "XIDLE", &noXIdleExtension, NULL, NULL }, #endif diff --git a/os/io.c b/os/io.c index e7ec60952..ccbe059af 100644 --- a/os/io.c +++ b/os/io.c @@ -118,13 +118,11 @@ static OsCommPtr AvailableInput = (OsCommPtr)NULL; #define get_req_len(req,cli) ((cli)->swapped ? \ lswaps((req)->length) : (req)->length) -#ifdef BIGREQS #include #define get_big_req_len(req,cli) ((cli)->swapped ? \ lswapl(((xBigReq *)(req))->length) : \ ((xBigReq *)(req))->length) -#endif #define MAX_TIMES_PER 10 @@ -204,9 +202,7 @@ ReadRequestFromClient(ClientPtr client) int result; register xReq *request; Bool need_header; -#ifdef BIGREQS Bool move_header; -#endif /* If an input buffer was empty, either free it if it is too big * or link it into our list of free input buffers. This means that @@ -255,9 +251,7 @@ ReadRequestFromClient(ClientPtr client) oci->bufptr += oci->lenLastReq; need_header = FALSE; -#ifdef BIGREQS move_header = FALSE; -#endif gotnow = oci->bufcnt + oci->buffer - oci->bufptr; if (gotnow < sizeof(xReq)) { @@ -274,7 +268,6 @@ ReadRequestFromClient(ClientPtr client) */ request = (xReq *)oci->bufptr; needed = get_req_len(request, client); -#ifdef BIGREQS if (!needed && client->big_requests) { /* It's a Big Request. */ @@ -288,7 +281,6 @@ ReadRequestFromClient(ClientPtr client) else needed = get_big_req_len(request, client); } -#endif client->req_len = needed; needed <<= 2; /* needed is in bytes now */ } @@ -301,14 +293,12 @@ ReadRequestFromClient(ClientPtr client) */ oci->lenLastReq = 0; -#ifdef BIGREQS if (needed > maxBigRequestSize << 2) { /* request is too big for us to handle */ YieldControlDeath(); return -1; } -#endif if ((gotnow == 0) || ((oci->bufptr - oci->buffer + needed) > oci->size)) { @@ -385,7 +375,6 @@ ReadRequestFromClient(ClientPtr client) /* We wanted an xReq, now we've gotten it. */ request = (xReq *)oci->bufptr; needed = get_req_len(request, client); -#ifdef BIGREQS if (!needed && client->big_requests) { move_header = TRUE; @@ -394,7 +383,6 @@ ReadRequestFromClient(ClientPtr client) else needed = get_big_req_len(request, client); } -#endif client->req_len = needed; needed <<= 2; } @@ -407,11 +395,9 @@ ReadRequestFromClient(ClientPtr client) } if (needed == 0) { -#ifdef BIGREQS if (client->big_requests) needed = sizeof(xBigReq); else -#endif needed = sizeof(xReq); } oci->lenLastReq = needed; @@ -429,12 +415,10 @@ ReadRequestFromClient(ClientPtr client) { request = (xReq *)(oci->bufptr + needed); if (gotnow >= (result = (get_req_len(request, client) << 2)) -#ifdef BIGREQS && (result || (client->big_requests && (gotnow >= sizeof(xBigReq) && gotnow >= (get_big_req_len(request, client) << 2)))) -#endif ) FD_SET(fd, &ClientsWithInput); else @@ -463,7 +447,6 @@ ReadRequestFromClient(ClientPtr client) #endif if (++timesThisConnection >= MAX_TIMES_PER) YieldControl(); -#ifdef BIGREQS if (move_header) { request = (xReq *)oci->bufptr; @@ -472,7 +455,6 @@ ReadRequestFromClient(ClientPtr client) oci->lenLastReq -= (sizeof(xBigReq) - sizeof(xReq)); client->req_len -= (sizeof(xBigReq) - sizeof(xReq)) >> 2; } -#endif client->requestBuffer = (pointer)oci->bufptr; #ifdef DEBUG_COMMUNICATION { @@ -584,7 +566,6 @@ ResetCurrentRequest(ClientPtr client) { request = (xReq *)oci->bufptr; needed = get_req_len(request, client); -#ifdef BIGREQS if (!needed && client->big_requests) { oci->bufptr -= sizeof(xBigReq) - sizeof(xReq); @@ -596,7 +577,6 @@ ResetCurrentRequest(ClientPtr client) swapl(&((xBigReq *)oci->bufptr)->length, n); } } -#endif if (gotnow >= (needed << 2)) { if (FD_ISSET(fd, &AllClients)) diff --git a/os/utils.c b/os/utils.c index c65c65916..6babd7f66 100644 --- a/os/utils.c +++ b/os/utils.c @@ -129,9 +129,6 @@ OR PERFORMANCE OF THIS SOFTWARE. #endif _X_EXPORT Bool noTestExtensions; -#ifdef BIGREQS -_X_EXPORT Bool noBigReqExtension = FALSE; -#endif #ifdef COMPOSITE _X_EXPORT Bool noCompositeExtension = FALSE; #endif