diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2015-04-15 12:41:23 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2015-04-15 12:41:23 +0200 |
commit | 9547a28faa9b4a9df02bea3cd55b011d615532e9 (patch) | |
tree | 8a51a34b718db91fd726bbaf1c0c8285e42af949 /nxcomp/ServerReadBuffer.cpp | |
parent | 6236266d4e18d4d264fab94643f9473ec3458e47 (diff) | |
download | nx-libs-feature/nxcomp-bigreq-support.tar.gz nx-libs-feature/nxcomp-bigreq-support.tar.bz2 nx-libs-feature/nxcomp-bigreq-support.zip |
Add BIGREQUEST extension support to nxproxy/nxcomp.feature/nxcomp-bigreq-support
This work has been started by Paul Szarbo but has been discontinued
before final completion. So, this is work in progress.
For reference / communication history, see [1].
[1] https://bugs.debian.org/766299
Diffstat (limited to 'nxcomp/ServerReadBuffer.cpp')
-rw-r--r-- | nxcomp/ServerReadBuffer.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/nxcomp/ServerReadBuffer.cpp b/nxcomp/ServerReadBuffer.cpp index 96c146b77..069da2b45 100644 --- a/nxcomp/ServerReadBuffer.cpp +++ b/nxcomp/ServerReadBuffer.cpp @@ -108,14 +108,21 @@ int ServerReadBuffer::locateMessage(const unsigned char *start, { dataLength = 32 + (GetULONG(start + 4, bigEndian_) << 2); } + else if (*start == GenericEvent && *(start+1) != 0) + { + // X Generic Event Extension + dataLength = 32 + (GetULONG(start + 4, bigEndian_) << 2); + } else { dataLength = 32; } - if (dataLength < 32) +// See WRITE_BUFFER_OVERFLOW_SIZE elsewhere +// and also ENCODE_BUFFER_OVERFLOW_SIZE DECODE_BUFFER_OVERFLOW_SIZE. + if (dataLength < 32 || dataLength > 100*1024*1024) { - #ifdef TEST + #ifdef WARNING *logofs << "ServerReadBuffer: WARNING! Assuming length 32 " << "for suspicious message of length " << dataLength << ".\n" << logofs_flush; |