xserver: Branch 'master'

Eric Anholt anholt at kemper.freedesktop.org
Fri Aug 31 13:21:26 PDT 2007


 os/io.c    |    4 +++-
 os/osdep.h |    3 ---
 2 files changed, 3 insertions(+), 4 deletions(-)

New commits:
diff-tree ca82d4bddf235c9b68d51d68636bab40eafb9889 (from a02db0d500cac20d0f0f107d27c064a175018421)
Author: Eric Anholt <eric at anholt.net>
Date:   Fri Aug 31 13:00:23 2007 -0700

    Bug #7186: Fix an excessive request size limitation that broke big-requests.
    
    MAXBUFSIZE appears to be a leftover of some previous time.  Instead, just
    use maxBigRequestSize when bigreqs are available (limiting buffers to ~16MB).
    When bigreqs are not available, needed won't be larger than the maximum
    size of a non-bigreqs request (256kB).

diff --git a/os/io.c b/os/io.c
index 835af54..9de75ee 100644
--- a/os/io.c
+++ b/os/io.c
@@ -304,12 +304,14 @@ ReadRequestFromClient(ClientPtr client)
 	 */
 
 	oci->lenLastReq = 0;
-	if (needed > MAXBUFSIZE)
+#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))
 	{
diff --git a/os/osdep.h b/os/osdep.h
index 965436d..2d455aa 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -55,9 +55,6 @@ SOFTWARE.
 #define BOTIMEOUT 200 /* in milliseconds */
 #define BUFSIZE 4096
 #define BUFWATERMARK 8192
-#ifndef MAXBUFSIZE
-#define MAXBUFSIZE (1 << 22)
-#endif
 
 #include <X11/Xdmcp.h>
 


More information about the xorg-commit mailing list