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).
This commit is contained in:
Eric Anholt 2007-08-31 13:00:23 -07:00
parent a02db0d500
commit ca82d4bddf
2 changed files with 3 additions and 4 deletions

View File

@ -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))
{

View File

@ -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>