Skip to content

Commit

Permalink
nxagent: Fix an excessive request size limitation that broke big-requ…
Browse files Browse the repository at this point in the history
…ests.

Fixes ArcticaProject#301, ArcticaProject#631

Backport from xorg-xserver:

  commit ca82d4bddf235c9b68d51d68636bab40eafb9889
  Author: Eric Anholt <eric@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).
  • Loading branch information
uli42 committed Oct 6, 2018
1 parent d3bbca7 commit da9d1a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nx-X11/programs/Xserver/os/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ ReadRequestFromClient(ClientPtr client)
*/

oci->lenLastReq = 0;
if (needed > MAXBUFSIZE)
#ifdef BIGREQS
if (needed > maxBigRequestSize << 2)
{
/* request is too big for us to handle */
/*
Expand All @@ -312,6 +313,7 @@ ReadRequestFromClient(ClientPtr client)
oci->lenLastReq = gotnow;
return needed;
}
#endif
if ((gotnow == 0) ||
((oci->bufptr - oci->buffer + needed) > oci->size))
{
Expand Down

0 comments on commit da9d1a5

Please sign in to comment.