Commit a9be6f59 authored by Fernando Carvajal's avatar Fernando Carvajal

Remove compatibility code for nxcomp before 3.5.0

As a part of nxcomp's clean-up process, compatibility with old protocol versions has been set now at 3.5.0. This commit removes compatibility code from nxcomp so the minimum supported version changes from 1.5.0 (protocol step 6) to 3.5.0 (protocol step 10). At this moment the removal is not complete and it will be followed by some other commits, in order to get rid of several components and files that are no longer used as they were only needed to work with old protocol versions. Refs: ArcticaProject/nx-libs#108
parent 2ffe52c5
...@@ -386,8 +386,7 @@ int Channel::handleDecode(DecodeBuffer &decodeBuffer, ChannelCache *channelCache ...@@ -386,8 +386,7 @@ int Channel::handleDecode(DecodeBuffer &decodeBuffer, ChannelCache *channelCache
if (store -> enableSplit == 1) if (store -> enableSplit == 1)
{ {
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
#ifdef DEBUG #ifdef DEBUG
*logofs << "handleDecode: " << store -> name() *logofs << "handleDecode: " << store -> name()
<< ": Checking if the message was split.\n" << ": Checking if the message was split.\n"
...@@ -395,7 +394,6 @@ int Channel::handleDecode(DecodeBuffer &decodeBuffer, ChannelCache *channelCache ...@@ -395,7 +394,6 @@ int Channel::handleDecode(DecodeBuffer &decodeBuffer, ChannelCache *channelCache
#endif #endif
decodeBuffer.decodeBoolValue(split); decodeBuffer.decodeBoolValue(split);
}
if (split == 1) if (split == 1)
{ {
...@@ -537,16 +535,9 @@ int Channel::handleEncodeCached(EncodeBuffer &encodeBuffer, ChannelCache *channe ...@@ -537,16 +535,9 @@ int Channel::handleEncodeCached(EncodeBuffer &encodeBuffer, ChannelCache *channe
if (control -> LocalDeltaCompression == 0 || if (control -> LocalDeltaCompression == 0 ||
enableCache_ == 0 || store -> enableCache == 0) enableCache_ == 0 || store -> enableCache == 0)
{ {
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
encodeBuffer.encodeActionValue(is_discarded, encodeBuffer.encodeActionValue(is_discarded,
store -> lastActionCache); store -> lastActionCache);
}
else
{
encodeBuffer.encodeActionValueCompat(is_discarded,
store -> lastActionCacheCompat);
}
store -> lastAction = is_discarded; store -> lastAction = is_discarded;
...@@ -601,19 +592,9 @@ int Channel::handleEncodeCached(EncodeBuffer &encodeBuffer, ChannelCache *channe ...@@ -601,19 +592,9 @@ int Channel::handleEncodeCached(EncodeBuffer &encodeBuffer, ChannelCache *channe
store -> lastRemoved = position; store -> lastRemoved = position;
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
encodeBuffer.encodeActionValue(is_removed, store -> lastRemoved, encodeBuffer.encodeActionValue(is_removed, store -> lastRemoved,
store -> lastActionCache); store -> lastActionCache);
}
else
{
encodeBuffer.encodeActionValueCompat(is_removed,
store -> lastActionCacheCompat);
encodeBuffer.encodePositionValueCompat(store -> lastRemoved,
store -> lastRemovedCacheCompat);
}
#ifdef DEBUG #ifdef DEBUG
*logofs << "handleEncodeCached: " << store -> name() << ": Going to " *logofs << "handleEncodeCached: " << store -> name() << ": Going to "
...@@ -679,16 +660,9 @@ int Channel::handleEncodeCached(EncodeBuffer &encodeBuffer, ChannelCache *channe ...@@ -679,16 +660,9 @@ int Channel::handleEncodeCached(EncodeBuffer &encodeBuffer, ChannelCache *channe
<< logofs_flush; << logofs_flush;
#endif #endif
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
encodeBuffer.encodeActionValue(is_discarded, encodeBuffer.encodeActionValue(is_discarded,
store -> lastActionCache); store -> lastActionCache);
}
else
{
encodeBuffer.encodeActionValueCompat(is_discarded,
store -> lastActionCacheCompat);
}
store -> lastAction = is_discarded; store -> lastAction = is_discarded;
...@@ -759,16 +733,9 @@ int Channel::handleEncodeCached(EncodeBuffer &encodeBuffer, ChannelCache *channe ...@@ -759,16 +733,9 @@ int Channel::handleEncodeCached(EncodeBuffer &encodeBuffer, ChannelCache *channe
<< logofs_flush; << logofs_flush;
#endif #endif
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
encodeBuffer.encodeActionValue(is_discarded, encodeBuffer.encodeActionValue(is_discarded,
store -> lastActionCache); store -> lastActionCache);
}
else
{
encodeBuffer.encodeActionValueCompat(is_discarded,
store -> lastActionCacheCompat);
}
store -> lastAction = is_discarded; store -> lastAction = is_discarded;
...@@ -793,16 +760,9 @@ int Channel::handleEncodeCached(EncodeBuffer &encodeBuffer, ChannelCache *channe ...@@ -793,16 +760,9 @@ int Channel::handleEncodeCached(EncodeBuffer &encodeBuffer, ChannelCache *channe
cerr << "Warning" << ": Message of size " << store -> plainSize(position) cerr << "Warning" << ": Message of size " << store -> plainSize(position)
<< " at position " << position << " is locked.\n"; << " at position " << position << " is locked.\n";
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
encodeBuffer.encodeActionValue(is_discarded, encodeBuffer.encodeActionValue(is_discarded,
store -> lastActionCache); store -> lastActionCache);
}
else
{
encodeBuffer.encodeActionValueCompat(is_discarded,
store -> lastActionCacheCompat);
}
store -> lastAction = is_discarded; store -> lastAction = is_discarded;
...@@ -843,21 +803,10 @@ int Channel::handleEncodeCached(EncodeBuffer &encodeBuffer, ChannelCache *channe ...@@ -843,21 +803,10 @@ int Channel::handleEncodeCached(EncodeBuffer &encodeBuffer, ChannelCache *channe
store -> lastAdded = position; store -> lastAdded = position;
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
encodeBuffer.encodeActionValue(IS_ADDED, store -> lastAdded, encodeBuffer.encodeActionValue(IS_ADDED, store -> lastAdded,
store -> lastActionCache); store -> lastActionCache);
}
else
{
encodeBuffer.encodeActionValueCompat(IS_ADDED,
store -> lastActionCacheCompat);
encodeBuffer.encodePositionValueCompat(store -> lastAdded,
store -> lastAddedCacheCompat);
}
return 0; return 0;
} }
else else
...@@ -898,19 +847,9 @@ int Channel::handleEncodeCached(EncodeBuffer &encodeBuffer, ChannelCache *channe ...@@ -898,19 +847,9 @@ int Channel::handleEncodeCached(EncodeBuffer &encodeBuffer, ChannelCache *channe
store -> lastHit = position; store -> lastHit = position;
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
encodeBuffer.encodeActionValue(IS_HIT, store -> lastHit, encodeBuffer.encodeActionValue(IS_HIT, store -> lastHit,
store -> lastActionCache); store -> lastActionCache);
}
else
{
encodeBuffer.encodeActionValueCompat(IS_HIT,
store -> lastActionCacheCompat);
encodeBuffer.encodePositionValueCompat(store -> lastHit,
store -> lastHitCacheCompat);
}
// //
// Send the field by field differences in // Send the field by field differences in
...@@ -997,16 +936,9 @@ int Channel::handleDecodeCached(DecodeBuffer &decodeBuffer, ChannelCache *channe ...@@ -997,16 +936,9 @@ int Channel::handleDecodeCached(DecodeBuffer &decodeBuffer, ChannelCache *channe
unsigned char action; unsigned char action;
unsigned short int position; unsigned short int position;
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
decodeBuffer.decodeActionValue(action, position, decodeBuffer.decodeActionValue(action, position,
store -> lastActionCache); store -> lastActionCache);
}
else
{
decodeBuffer.decodeActionValueCompat(action,
store -> lastActionCacheCompat);
}
// //
// Clean operations must always come // Clean operations must always come
...@@ -1015,15 +947,8 @@ int Channel::handleDecodeCached(DecodeBuffer &decodeBuffer, ChannelCache *channe ...@@ -1015,15 +947,8 @@ int Channel::handleDecodeCached(DecodeBuffer &decodeBuffer, ChannelCache *channe
while (action == is_removed) while (action == is_removed)
{ {
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
store -> lastRemoved = position; store -> lastRemoved = position;
}
else
{
decodeBuffer.decodePositionValueCompat(store -> lastRemoved,
store -> lastRemovedCacheCompat);
}
#ifdef DEBUG #ifdef DEBUG
...@@ -1046,17 +971,10 @@ int Channel::handleDecodeCached(DecodeBuffer &decodeBuffer, ChannelCache *channe ...@@ -1046,17 +971,10 @@ int Channel::handleDecodeCached(DecodeBuffer &decodeBuffer, ChannelCache *channe
store -> remove(store -> lastRemoved, discard_checksum, use_data); store -> remove(store -> lastRemoved, discard_checksum, use_data);
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
decodeBuffer.decodeActionValue(action, position, decodeBuffer.decodeActionValue(action, position,
store -> lastActionCache); store -> lastActionCache);
} }
else
{
decodeBuffer.decodeActionValueCompat(action,
store -> lastActionCacheCompat);
}
}
// //
// If it's a cache hit, the position // If it's a cache hit, the position
...@@ -1065,15 +983,8 @@ int Channel::handleDecodeCached(DecodeBuffer &decodeBuffer, ChannelCache *channe ...@@ -1065,15 +983,8 @@ int Channel::handleDecodeCached(DecodeBuffer &decodeBuffer, ChannelCache *channe
if ((T_store_action) action == IS_HIT) if ((T_store_action) action == IS_HIT)
{ {
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
store -> lastHit = position; store -> lastHit = position;
}
else
{
decodeBuffer.decodePositionValueCompat(store -> lastHit,
store -> lastHitCacheCompat);
}
// //
// Get data from the cache at given position. // Get data from the cache at given position.
...@@ -1139,15 +1050,8 @@ int Channel::handleDecodeCached(DecodeBuffer &decodeBuffer, ChannelCache *channe ...@@ -1139,15 +1050,8 @@ int Channel::handleDecodeCached(DecodeBuffer &decodeBuffer, ChannelCache *channe
} }
else if ((T_store_action) action == IS_ADDED) else if ((T_store_action) action == IS_ADDED)
{ {
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
store -> lastAdded = position; store -> lastAdded = position;
}
else
{
decodeBuffer.decodePositionValueCompat(store -> lastAdded,
store -> lastAddedCacheCompat);
}
#ifdef DEBUG #ifdef DEBUG
*logofs << "handleDecodeCached: " << store -> name() *logofs << "handleDecodeCached: " << store -> name()
...@@ -2037,12 +1941,10 @@ Split *Channel::handleSplitCommitRemove(int request, int resource, int position) ...@@ -2037,12 +1941,10 @@ Split *Channel::handleSplitCommitRemove(int request, int resource, int position)
<< ".\n" << logofs_flush; << ".\n" << logofs_flush;
#endif #endif
if ((control -> isProtoStep7() == 1 && // Since ProtoStep7 (#issue 108)
(resource != split -> getResource() || if (resource != split -> getResource() ||
request != split -> getRequest() || request != split -> getRequest() ||
position != split -> getPosition())) || position != split -> getPosition())
(request != split -> getRequest() ||
position != split -> getPosition()))
{ {
#ifdef PANIC #ifdef PANIC
*logofs << "handleSplitCommitRemove: PANIC! The data in " *logofs << "handleSplitCommitRemove: PANIC! The data in "
......
...@@ -25,7 +25,6 @@ ClientCache::ClientCache() : ...@@ -25,7 +25,6 @@ ClientCache::ClientCache() :
changePropertyPropertyCache(16), changePropertyTypeCache(16), changePropertyPropertyCache(16), changePropertyTypeCache(16),
changePropertyData32Cache(16), changePropertyData32Cache(16),
changePropertyTextCompressor(textCache, CLIENT_TEXT_CACHE_SIZE),
configureWindowBitmaskCache(4), configureWindowBitmaskCache(4),
...@@ -53,17 +52,11 @@ ClientCache::ClientCache() : ...@@ -53,17 +52,11 @@ ClientCache::ClientCache() :
imageTextLengthCache(8), imageTextLengthCache(8),
imageTextLastX(0), imageTextLastY(0), imageTextLastX(0), imageTextLastY(0),
imageTextCacheX(8), imageTextCacheY(8), imageTextCacheX(8), imageTextCacheY(8),
imageTextTextCompressor(textCache, CLIENT_TEXT_CACHE_SIZE),
internAtomTextCompressor(textCache, CLIENT_TEXT_CACHE_SIZE),
openFontTextCompressor(textCache, CLIENT_TEXT_CACHE_SIZE),
polySegmentCacheX(8), polySegmentCacheY(8), polySegmentCacheIndex(0), polySegmentCacheX(8), polySegmentCacheY(8), polySegmentCacheIndex(0),
polyTextLastX(0), polyTextLastY(0), polyTextCacheX(8), polyTextLastX(0), polyTextLastY(0), polyTextCacheX(8),
polyTextCacheY(8), polyTextFontCache(8), polyTextCacheY(8), polyTextFontCache(8),
polyTextTextCompressor(textCache, CLIENT_TEXT_CACHE_SIZE),
putImageWidthCache(8), putImageHeightCache(8), putImageLastX(0), putImageWidthCache(8), putImageHeightCache(8), putImageLastX(0),
putImageLastY(0), putImageXCache(8), putImageYCache(8), putImageLastY(0), putImageXCache(8), putImageYCache(8),
......
...@@ -85,7 +85,6 @@ class ClientCache : public ChannelCache ...@@ -85,7 +85,6 @@ class ClientCache : public ChannelCache
IntCache changePropertyPropertyCache; IntCache changePropertyPropertyCache;
IntCache changePropertyTypeCache; IntCache changePropertyTypeCache;
IntCache changePropertyData32Cache; IntCache changePropertyData32Cache;
TextCompressor changePropertyTextCompressor;
// //
// ClearArea request. // ClearArea request.
...@@ -188,19 +187,6 @@ class ClientCache : public ChannelCache ...@@ -188,19 +187,6 @@ class ClientCache : public ChannelCache
unsigned int imageTextLastY; unsigned int imageTextLastY;
IntCache imageTextCacheX; IntCache imageTextCacheX;
IntCache imageTextCacheY; IntCache imageTextCacheY;
TextCompressor imageTextTextCompressor;
//
// InternAtom request.
//
TextCompressor internAtomTextCompressor;
//
// OpenFont request.
//
TextCompressor openFontTextCompressor;
// //
// PolyFillRectangle request. // PolyFillRectangle request.
...@@ -251,7 +237,6 @@ class ClientCache : public ChannelCache ...@@ -251,7 +237,6 @@ class ClientCache : public ChannelCache
IntCache polyTextCacheY; IntCache polyTextCacheY;
IntCache polyTextFontCache; IntCache polyTextFontCache;
CharCache polyTextDeltaCache; CharCache polyTextDeltaCache;
TextCompressor polyTextTextCompressor;
// //
// PutImage request. // PutImage request.
......
...@@ -158,23 +158,6 @@ class ClientChannel : public Channel ...@@ -158,23 +158,6 @@ class ClientChannel : public Channel
int handleTaintRequest(unsigned char &opcode, const unsigned char *&buffer, int handleTaintRequest(unsigned char &opcode, const unsigned char *&buffer,
unsigned int &size) unsigned int &size)
{ {
if (control -> isProtoStep7() == 0)
{
if (opcode == X_NXFreeSplit || opcode == X_NXAbortSplit ||
opcode == X_NXFinishSplit)
{
return handleTaintSplitRequest(opcode, buffer, size);
}
else if (opcode == X_NXSetCacheParameters)
{
return handleTaintCacheRequest(opcode, buffer, size);
}
else if (opcode == X_NXGetFontParameters)
{
return handleTaintFontRequest(opcode, buffer, size);
}
}
if (control -> TaintReplies > 0 && if (control -> TaintReplies > 0 &&
opcode == X_GetInputFocus) opcode == X_GetInputFocus)
{ {
...@@ -190,15 +173,6 @@ class ClientChannel : public Channel ...@@ -190,15 +173,6 @@ class ClientChannel : public Channel
return 0; return 0;
} }
int handleTaintCacheRequest(unsigned char &opcode, const unsigned char *&buffer,
unsigned int &size);
int handleTaintFontRequest(unsigned char &opcode, const unsigned char *&buffer,
unsigned int &size);
int handleTaintSplitRequest(unsigned char &opcode, const unsigned char *&buffer,
unsigned int &size);
int handleTaintLameRequest(unsigned char &opcode, const unsigned char *&buffer, int handleTaintLameRequest(unsigned char &opcode, const unsigned char *&buffer,
unsigned int &size); unsigned int &size);
...@@ -261,20 +235,6 @@ class ClientChannel : public Channel ...@@ -261,20 +235,6 @@ class ClientChannel : public Channel
int handleSplitChecksum(EncodeBuffer &encodeBuffer, T_checksum checksum); int handleSplitChecksum(EncodeBuffer &encodeBuffer, T_checksum checksum);
void handleSplitEnable()
{
if (control -> isProtoStep7() == 0)
{
#if defined(TEST) || defined(SPLIT)
*logofs << "handleSplitEnable: WARNING! Disabling split "
<< "with an old proxy version.\n"
<< logofs_flush;
#endif
enableSplit_ = 0;
}
}
void handleSplitPending(int resource) void handleSplitPending(int resource)
{ {
if (splitState_.pending == 0) if (splitState_.pending == 0)
......
...@@ -84,15 +84,9 @@ class ClientProxy : public Proxy ...@@ -84,15 +84,9 @@ class ClientProxy : public Proxy
virtual int checkLocalChannelMap(int channelId) virtual int checkLocalChannelMap(int channelId)
{ {
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
return ((channelId & control -> ChannelMask) != 0); return ((channelId & control -> ChannelMask) != 0);
} }
else
{
return 1;
}
}
// //
// Ports where to forward extended services' // Ports where to forward extended services'
......
...@@ -54,11 +54,6 @@ ...@@ -54,11 +54,6 @@
#include "PutPackedImage.h" #include "PutPackedImage.h"
#include "GenericRequest.h" #include "GenericRequest.h"
#include "ChangeGCCompat.h"
#include "CreatePixmapCompat.h"
#include "SetUnpackColormapCompat.h"
#include "SetUnpackAlphaCompat.h"
// //
// Set the verbosity level. // Set the verbosity level.
// //
...@@ -111,20 +106,11 @@ ClientStore::ClientStore(StaticCompressor *compressor) ...@@ -111,20 +106,11 @@ ClientStore::ClientStore(StaticCompressor *compressor)
requests_[X_NXSetUnpackGeometry] = new SetUnpackGeometryStore(compressor); requests_[X_NXSetUnpackGeometry] = new SetUnpackGeometryStore(compressor);
requests_[X_NXPutPackedImage] = new PutPackedImageStore(compressor); requests_[X_NXPutPackedImage] = new PutPackedImageStore(compressor);
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
requests_[X_ChangeGC] = new ChangeGCStore(); requests_[X_ChangeGC] = new ChangeGCStore();
requests_[X_CreatePixmap] = new CreatePixmapStore(); requests_[X_CreatePixmap] = new CreatePixmapStore();
requests_[X_NXSetUnpackColormap] = new SetUnpackColormapStore(compressor); requests_[X_NXSetUnpackColormap] = new SetUnpackColormapStore(compressor);
requests_[X_NXSetUnpackAlpha] = new SetUnpackAlphaStore(compressor); requests_[X_NXSetUnpackAlpha] = new SetUnpackAlphaStore(compressor);
}
else
{
requests_[X_ChangeGC] = new ChangeGCCompatStore();
requests_[X_CreatePixmap] = new CreatePixmapCompatStore();
requests_[X_NXSetUnpackColormap] = new SetUnpackColormapCompatStore(compressor);
requests_[X_NXSetUnpackAlpha] = new SetUnpackAlphaCompatStore(compressor);
}
for (int i = 0; i < CHANNEL_STORE_RESOURCE_LIMIT; i++) for (int i = 0; i < CHANNEL_STORE_RESOURCE_LIMIT; i++)
{ {
......
...@@ -349,6 +349,14 @@ ...@@ -349,6 +349,14 @@
#define FILE_SIZE_CHECK_TIMEOUT 60000 #define FILE_SIZE_CHECK_TIMEOUT 60000
// //
// Protocol version compatibility values
//
const int Control::NX_MIN_PROTO_STEP = 10;
const int Control::NX_MAX_PROTO_STEP = 10;
const char* const Control::NXPROXY_COMPATIBILITY_VERSION = "3.5.0";
//
// Set defaults for control. They should be what // Set defaults for control. They should be what
// you get in case of 'local' connection. // you get in case of 'local' connection.
// //
...@@ -633,11 +641,7 @@ Control::Control() ...@@ -633,11 +641,7 @@ Control::Control()
// time the session is negotiated. // time the session is negotiated.
// //
protoStep6_ = 0; protoStep_ = 0;
protoStep7_ = 0;
protoStep8_ = 0;
protoStep9_ = 0;
protoStep10_ = 0;
} }
Control::~Control() Control::~Control()
...@@ -705,59 +709,11 @@ Control::~Control() ...@@ -705,59 +709,11 @@ Control::~Control()
void Control::setProtoStep(int step) void Control::setProtoStep(int step)
{ {
switch (step) if (isValidProtoStep(step))
{
case 6:
{
protoStep6_ = 1;
protoStep7_ = 0;
protoStep8_ = 0;
protoStep9_ = 0;
protoStep10_ = 0;
break;
}
case 7:
{
protoStep6_ = 1;
protoStep7_ = 1;
protoStep8_ = 0;
protoStep9_ = 0;
protoStep10_ = 0;
break;
}
case 8:
{
protoStep6_ = 1;
protoStep7_ = 1;
protoStep8_ = 1;
protoStep9_ = 0;
protoStep10_ = 0;
break;
}
case 9:
{ {
protoStep6_ = 1; protoStep_ = step;
protoStep7_ = 1;
protoStep8_ = 1;
protoStep9_ = 1;
protoStep10_ = 0;
break;
}
case 10:
{
protoStep6_ = 1;
protoStep7_ = 1;
protoStep8_ = 1;
protoStep9_ = 1;
protoStep10_ = 1;
break;
} }
default: else
{ {
#ifdef PANIC #ifdef PANIC
*logofs << "Control: PANIC! Invalid protocol step " *logofs << "Control: PANIC! Invalid protocol step "
...@@ -767,30 +723,13 @@ void Control::setProtoStep(int step) ...@@ -767,30 +723,13 @@ void Control::setProtoStep(int step)
HandleCleanup(); HandleCleanup();
} }
}
} }
int Control::getProtoStep() int Control::getProtoStep()
{ {
if (protoStep10_ == 1) if (isValidProtoStep(protoStep_))
{
return 10;
}
else if (protoStep9_ == 1)
{
return 9;
}
else if (protoStep8_ == 1)
{
return 8;
}
else if (protoStep7_ == 1)
{
return 7;
}
else if (protoStep6_ == 1)
{ {
return 6; return protoStep_;
} }
else else
{ {
......
...@@ -321,6 +321,12 @@ class Control ...@@ -321,6 +321,12 @@ class Control
int CompatVersionMaintenancePatch; int CompatVersionMaintenancePatch;
// //
// Compatibility version for the proxy
//
static const char* const NXPROXY_COMPATIBILITY_VERSION;
//
// Which unpack methods are implemented in proxy? // Which unpack methods are implemented in proxy?
// //
...@@ -713,26 +719,6 @@ class Control ...@@ -713,26 +719,6 @@ class Control
int getProtoStep(); int getProtoStep();
int isProtoStep7()
{
return protoStep7_;
}
int isProtoStep8()
{
return protoStep8_;
}
int isProtoStep9()
{
return protoStep9_;
}
int isProtoStep10()
{
return protoStep10_;
}
private: private:
// //
...@@ -746,11 +732,25 @@ class Control ...@@ -746,11 +732,25 @@ class Control
// to the protocol version. // to the protocol version.
// //
int protoStep6_; int protoStep_;
int protoStep7_;
int protoStep8_; //
int protoStep9_; // Min and max values allowed for protocol step
int protoStep10_; // depending on protocol version compatibility
//
static const int NX_MIN_PROTO_STEP;
static const int NX_MAX_PROTO_STEP;
//
// Check the validity of protocol step
//
bool isValidProtoStep(int step)
{
return ((step >= NX_MIN_PROTO_STEP) && (step <= NX_MAX_PROTO_STEP));
}
}; };
#endif /* Control_H */ #endif /* Control_H */
...@@ -146,8 +146,7 @@ void CreateGCStore::updateIdentity(EncodeBuffer &encodeBuffer, const Message *me ...@@ -146,8 +146,7 @@ void CreateGCStore::updateIdentity(EncodeBuffer &encodeBuffer, const Message *me
ClientCache *clientCache = (ClientCache *) channelCache; ClientCache *clientCache = (ClientCache *) channelCache;
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
#ifdef TEST #ifdef TEST
*logofs << name() << ": Encoding value " << createGC -> gcontext *logofs << name() << ": Encoding value " << createGC -> gcontext
<< " as gcontext field.\n" << logofs_flush; << " as gcontext field.\n" << logofs_flush;
...@@ -158,27 +157,6 @@ void CreateGCStore::updateIdentity(EncodeBuffer &encodeBuffer, const Message *me ...@@ -158,27 +157,6 @@ void CreateGCStore::updateIdentity(EncodeBuffer &encodeBuffer, const Message *me
clientCache -> freeGCCache); clientCache -> freeGCCache);
cachedCreateGC -> gcontext = createGC -> gcontext; cachedCreateGC -> gcontext = createGC -> gcontext;
}
else
{
#ifdef TEST
*logofs << name() << ": Encoding value " << createGC -> drawable
<< " as drawable field.\n" << logofs_flush;
#endif
encodeBuffer.encodeXidValue(createGC -> drawable, clientCache -> drawableCache);
cachedCreateGC -> drawable = createGC -> drawable;
#ifdef TEST
*logofs << name() << ": Encoding value " << createGC -> gcontext
<< " as gcontext field.\n" << logofs_flush;
#endif
encodeBuffer.encodeXidValue(createGC -> gcontext, clientCache -> gcCache);
cachedCreateGC -> gcontext = createGC -> gcontext;
}
} }
void CreateGCStore::updateIdentity(DecodeBuffer &decodeBuffer, const Message *message, void CreateGCStore::updateIdentity(DecodeBuffer &decodeBuffer, const Message *message,
...@@ -190,8 +168,7 @@ void CreateGCStore::updateIdentity(DecodeBuffer &decodeBuffer, const Message *me ...@@ -190,8 +168,7 @@ void CreateGCStore::updateIdentity(DecodeBuffer &decodeBuffer, const Message *me
unsigned int value; unsigned int value;
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
decodeBuffer.decodeNewXidValue(value, clientCache -> lastId, decodeBuffer.decodeNewXidValue(value, clientCache -> lastId,
clientCache -> lastIdCache, clientCache -> gcCache, clientCache -> lastIdCache, clientCache -> gcCache,
clientCache -> freeGCCache); clientCache -> freeGCCache);
...@@ -202,25 +179,4 @@ void CreateGCStore::updateIdentity(DecodeBuffer &decodeBuffer, const Message *me ...@@ -202,25 +179,4 @@ void CreateGCStore::updateIdentity(DecodeBuffer &decodeBuffer, const Message *me
*logofs << name() << ": Decoded value " << createGC -> gcontext *logofs << name() << ": Decoded value " << createGC -> gcontext
<< " as gcontext field.\n" << logofs_flush; << " as gcontext field.\n" << logofs_flush;
#endif #endif
}
else
{
decodeBuffer.decodeXidValue(value, clientCache -> drawableCache);
createGC -> drawable = value;
#ifdef TEST
*logofs << name() << ": Decoded value " << createGC -> drawable
<< " as drawable field.\n" << logofs_flush;
#endif
decodeBuffer.decodeXidValue(value, clientCache -> gcCache);
createGC -> gcontext = value;
#ifdef TEST
*logofs << name() << ": Decoded value " << createGC -> gcontext
<< " as gcontext field.\n" << logofs_flush;
#endif
}
} }
...@@ -34,10 +34,8 @@ DecodeBuffer::DecodeBuffer(const unsigned char *data, unsigned int length) ...@@ -34,10 +34,8 @@ DecodeBuffer::DecodeBuffer(const unsigned char *data, unsigned int length)
: buffer_(data), end_(buffer_ + length), nextSrc_(buffer_), srcMask_(0x80) : buffer_(data), end_(buffer_ + length), nextSrc_(buffer_), srcMask_(0x80)
{ {
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
end_ = buffer_ + length - DECODE_BUFFER_POSTFIX_SIZE; end_ = buffer_ + length - DECODE_BUFFER_POSTFIX_SIZE;
}
} }
int DecodeBuffer::decodeValue(unsigned int &value, unsigned int numBits, int DecodeBuffer::decodeValue(unsigned int &value, unsigned int numBits,
...@@ -277,8 +275,7 @@ int DecodeBuffer::decodeCachedValue(unsigned int &value, unsigned int numBits, ...@@ -277,8 +275,7 @@ int DecodeBuffer::decodeCachedValue(unsigned int &value, unsigned int numBits,
if (index == 2) if (index == 2)
{ {
if (control -> isProtoStep8() == 1) // Since ProtoStep8 (#issue 108)
{
blockSize = cache.getBlockSize(blockSize); blockSize = cache.getBlockSize(blockSize);
if (decodeValue(value, numBits, blockSize, endOkay)) if (decodeValue(value, numBits, blockSize, endOkay))
...@@ -300,43 +297,6 @@ int DecodeBuffer::decodeCachedValue(unsigned int &value, unsigned int numBits, ...@@ -300,43 +297,6 @@ int DecodeBuffer::decodeCachedValue(unsigned int &value, unsigned int numBits,
} }
else else
{ {
unsigned int sameDiff;
decodeBoolValue(sameDiff);
if (sameDiff)
{
value = cache.getLastDiff(IntMask[numBits]);
cache.insert(value, IntMask[numBits]);
return 1;
}
else
{
blockSize = cache.getBlockSize(blockSize);
if (decodeValue(value, numBits, blockSize, endOkay))
{
cache.insert(value, IntMask[numBits]);
return 1;
}
#ifdef PANIC
*logofs << "DecodeBuffer: PANIC! Assertion failed. Error [H] "
<< "in decodeCacheValue() with no value found.\n"
<< logofs_flush;
#endif
cerr << "Error" << ": Failure decoding data in context [H].\n";
HandleAbort();
}
}
}
else
{
if (index > 2) if (index > 2)
{ {
index--; index--;
...@@ -665,28 +625,3 @@ void DecodeBuffer::decodeFreeXidValue(unsigned int &value, FreeCache &cache) ...@@ -665,28 +625,3 @@ void DecodeBuffer::decodeFreeXidValue(unsigned int &value, FreeCache &cache)
decodeCachedValue(value, 29, cache); decodeCachedValue(value, 29, cache);
} }
void DecodeBuffer::decodePositionValueCompat(short int &value, PositionCacheCompat &cache)
{
unsigned int t;
decodeCachedValue(t, 13, *(cache.base_[cache.slot_]));
cache.last_ += t;
cache.last_ &= 0x1fff;
value = cache.last_;
#ifdef DEBUG
*logofs << "DecodeBuffer: Decoded position "
<< value << " with base " << cache.slot_
<< ".\n" << logofs_flush;
#endif
#ifdef DEBUG
*logofs << "DecodeBuffer: Position block prediction is "
<< (*(cache.base_[cache.slot_])).getBlockSize(13)
<< ".\n" << logofs_flush;
#endif
cache.slot_ = (value & 0x1f);
}
...@@ -27,9 +27,6 @@ ...@@ -27,9 +27,6 @@
#include "OpcodeCache.h" #include "OpcodeCache.h"
#include "ActionCache.h" #include "ActionCache.h"
#include "ActionCacheCompat.h"
#include "PositionCacheCompat.h"
#define DECODE_BUFFER_OVERFLOW_SIZE 4194304 #define DECODE_BUFFER_OVERFLOW_SIZE 4194304
#define DECODE_BUFFER_POSTFIX_SIZE 1 #define DECODE_BUFFER_POSTFIX_SIZE 1
...@@ -99,15 +96,6 @@ class DecodeBuffer ...@@ -99,15 +96,6 @@ class DecodeBuffer
void decodeFreeXidValue(unsigned int &value, FreeCache &cache); void decodeFreeXidValue(unsigned int &value, FreeCache &cache);
void decodeActionValueCompat(unsigned char &value, ActionCacheCompat &cache)
{
decodeCachedValue(value, 2, cache.base_[cache.slot_]);
cache.slot_ = value;
}
void decodePositionValueCompat(short int &value, PositionCacheCompat &cache);
void decodeTextData(unsigned char *buffer, unsigned int numBytes) void decodeTextData(unsigned char *buffer, unsigned int numBytes)
{ {
decodeMemory(buffer, numBytes); decodeMemory(buffer, numBytes);
......
...@@ -261,8 +261,7 @@ void EncodeBuffer::encodeCachedValue(unsigned int value, unsigned int numBits, ...@@ -261,8 +261,7 @@ void EncodeBuffer::encodeCachedValue(unsigned int value, unsigned int numBits,
// Avoid to encode the additional bool. // Avoid to encode the additional bool.
// //
if (control -> isProtoStep8() == 1) // Since ProtoStep8 (#issue 108)
{
#ifdef DUMP #ifdef DUMP
*logofs << "EncodeBuffer: Encoded missed int using " *logofs << "EncodeBuffer: Encoded missed int using "
<< diffBits() << " bits out of " << numBits << diffBits() << " bits out of " << numBits
...@@ -271,38 +270,6 @@ void EncodeBuffer::encodeCachedValue(unsigned int value, unsigned int numBits, ...@@ -271,38 +270,6 @@ void EncodeBuffer::encodeCachedValue(unsigned int value, unsigned int numBits,
encodeValue(value, numBits, blockSize); encodeValue(value, numBits, blockSize);
} }
else
{
if (sameDiff)
{
#ifdef DUMP
*logofs << "EncodeBuffer: Matched difference with block size "
<< cache.getBlockSize(blockSize) << ".\n"
<< logofs_flush;
#endif
encodeBoolValue(1);
}
else
{
#ifdef DUMP
*logofs << "EncodeBuffer: Missed difference with block size "
<< cache.getBlockSize(blockSize) << ".\n"
<< logofs_flush;
#endif
encodeBoolValue(0);
encodeValue(value, numBits, blockSize);
}
#ifdef DUMP
*logofs << "EncodeBuffer: Encoded missed int using "
<< diffBits() << " bits out of " << numBits
<< ".\n" << logofs_flush;
#endif
}
}
} }
void EncodeBuffer::encodeCachedValue(unsigned char value, unsigned int numBits, void EncodeBuffer::encodeCachedValue(unsigned char value, unsigned int numBits,
...@@ -454,7 +421,8 @@ unsigned int EncodeBuffer::getLength() const ...@@ -454,7 +421,8 @@ unsigned int EncodeBuffer::getLength() const
length++; length++;
} }
if (length > 0 && control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
if (length > 0)
{ {
return length + ENCODE_BUFFER_POSTFIX_SIZE; return length + ENCODE_BUFFER_POSTFIX_SIZE;
} }
...@@ -641,20 +609,3 @@ void EncodeBuffer::encodeFreeXidValue(unsigned int value, FreeCache &cache) ...@@ -641,20 +609,3 @@ void EncodeBuffer::encodeFreeXidValue(unsigned int value, FreeCache &cache)
{ {
encodeCachedValue(value, 29, cache); encodeCachedValue(value, 29, cache);
} }
void EncodeBuffer::encodePositionValueCompat(short int value, PositionCacheCompat &cache)
{
unsigned int t = (value - cache.last_);
encodeCachedValue(t, 13, *(cache.base_[cache.slot_]));
cache.last_ = value;
#ifdef DEBUG
*logofs << "EncodeBuffer: Encoded position "
<< value << " with base " << cache.slot_
<< ".\n" << logofs_flush;
#endif
cache.slot_ = (value & 0x1f);
}
...@@ -25,9 +25,6 @@ ...@@ -25,9 +25,6 @@
#include "OpcodeCache.h" #include "OpcodeCache.h"
#include "ActionCache.h" #include "ActionCache.h"
#include "ActionCacheCompat.h"
#include "PositionCacheCompat.h"
#define ENCODE_BUFFER_DEFAULT_SIZE 16384 #define ENCODE_BUFFER_DEFAULT_SIZE 16384
// //
...@@ -117,15 +114,6 @@ class EncodeBuffer ...@@ -117,15 +114,6 @@ class EncodeBuffer
void encodeFreeXidValue(unsigned int value, FreeCache &cache); void encodeFreeXidValue(unsigned int value, FreeCache &cache);
void encodeActionValueCompat(unsigned char value, ActionCacheCompat &cache)
{
encodeCachedValue(value, 2, cache.base_[cache.slot_]);
cache.slot_ = value;
}
void encodePositionValueCompat(short int value, PositionCacheCompat &cache);
void encodeTextData(const unsigned char *buffer, unsigned int numBytes) void encodeTextData(const unsigned char *buffer, unsigned int numBytes)
{ {
encodeMemory(buffer, numBytes); encodeMemory(buffer, numBytes);
......
...@@ -51,8 +51,8 @@ int FillPolyStore::parseIdentity(Message *message, const unsigned char *buffer, ...@@ -51,8 +51,8 @@ int FillPolyStore::parseIdentity(Message *message, const unsigned char *buffer,
fillPoly -> shape = *(buffer + 12); fillPoly -> shape = *(buffer + 12);
fillPoly -> mode = *(buffer + 13); fillPoly -> mode = *(buffer + 13);
if (control -> isProtoStep8() == 1 && // Since ProtoStep8 (#issue 108)
size >= (unsigned int) dataOffset) if (size >= (unsigned int) dataOffset)
{ {
fillPoly -> x_origin = GetUINT(buffer + 16, bigEndian); fillPoly -> x_origin = GetUINT(buffer + 16, bigEndian);
fillPoly -> y_origin = GetUINT(buffer + 18, bigEndian); fillPoly -> y_origin = GetUINT(buffer + 18, bigEndian);
...@@ -85,8 +85,8 @@ int FillPolyStore::unparseIdentity(const Message *message, unsigned char *buffer ...@@ -85,8 +85,8 @@ int FillPolyStore::unparseIdentity(const Message *message, unsigned char *buffer
*(buffer + 12) = fillPoly -> shape; *(buffer + 12) = fillPoly -> shape;
*(buffer + 13) = fillPoly -> mode; *(buffer + 13) = fillPoly -> mode;
if (control -> isProtoStep8() == 1 && // Since ProtoStep8 (#issue 108)
size >= (unsigned int) dataOffset) if (size >= (unsigned int) dataOffset)
{ {
PutUINT(fillPoly -> x_origin, buffer + 16, bigEndian); PutUINT(fillPoly -> x_origin, buffer + 16, bigEndian);
PutUINT(fillPoly -> y_origin, buffer + 18, bigEndian); PutUINT(fillPoly -> y_origin, buffer + 18, bigEndian);
...@@ -151,8 +151,8 @@ void FillPolyStore::updateIdentity(EncodeBuffer &encodeBuffer, const Message *me ...@@ -151,8 +151,8 @@ void FillPolyStore::updateIdentity(EncodeBuffer &encodeBuffer, const Message *me
cachedFillPoly -> gcontext = fillPoly -> gcontext; cachedFillPoly -> gcontext = fillPoly -> gcontext;
if (control -> isProtoStep8() == 1 && // Since ProtoStep8 (#issue 108)
fillPoly -> size_ >= dataOffset) if (fillPoly -> size_ >= dataOffset)
{ {
#ifdef TEST #ifdef TEST
*logofs << name() << ": Encoding value " << fillPoly -> x_origin *logofs << name() << ": Encoding value " << fillPoly -> x_origin
...@@ -197,8 +197,8 @@ void FillPolyStore::updateIdentity(DecodeBuffer &decodeBuffer, const Message *me ...@@ -197,8 +197,8 @@ void FillPolyStore::updateIdentity(DecodeBuffer &decodeBuffer, const Message *me
<< " as gcontext field.\n" << logofs_flush; << " as gcontext field.\n" << logofs_flush;
#endif #endif
if (control -> isProtoStep8() == 1 && // Since ProtoStep8 (#issue 108)
fillPoly -> size_ >= dataOffset) if (fillPoly -> size_ >= dataOffset)
{ {
unsigned int value; unsigned int value;
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#define FILLPOLY_ENABLE_COMPRESS 0 #define FILLPOLY_ENABLE_COMPRESS 0
#define FILLPOLY_DATA_LIMIT 512 #define FILLPOLY_DATA_LIMIT 512
#define FILLPOLY_DATA_OFFSET 16
#define FILLPOLY_CACHE_SLOTS 2000 #define FILLPOLY_CACHE_SLOTS 2000
#define FILLPOLY_CACHE_THRESHOLD 3 #define FILLPOLY_CACHE_THRESHOLD 3
...@@ -98,12 +97,9 @@ class FillPolyStore : public MessageStore ...@@ -98,12 +97,9 @@ class FillPolyStore : public MessageStore
enableCompress = FILLPOLY_ENABLE_COMPRESS; enableCompress = FILLPOLY_ENABLE_COMPRESS;
dataLimit = FILLPOLY_DATA_LIMIT; dataLimit = FILLPOLY_DATA_LIMIT;
dataOffset = FILLPOLY_DATA_OFFSET;
if (control -> isProtoStep8() == 1) // Since ProtoStep8 (#issue 108)
{
dataOffset = FILLPOLY_DATA_OFFSET_IF_PROTO_STEP_8; dataOffset = FILLPOLY_DATA_OFFSET_IF_PROTO_STEP_8;
}
cacheSlots = FILLPOLY_CACHE_SLOTS; cacheSlots = FILLPOLY_CACHE_SLOTS;
cacheThreshold = FILLPOLY_CACHE_THRESHOLD; cacheThreshold = FILLPOLY_CACHE_THRESHOLD;
...@@ -169,11 +165,9 @@ class FillPolyStore : public MessageStore ...@@ -169,11 +165,9 @@ class FillPolyStore : public MessageStore
virtual int identitySize(const unsigned char *buffer, unsigned int size) virtual int identitySize(const unsigned char *buffer, unsigned int size)
{ {
unsigned int offset = (control -> isProtoStep8() == 1 ? // Since ProtoStep8 (#issue 108)
FILLPOLY_DATA_OFFSET_IF_PROTO_STEP_8 : return (size >= FILLPOLY_DATA_OFFSET_IF_PROTO_STEP_8 ?
FILLPOLY_DATA_OFFSET); FILLPOLY_DATA_OFFSET_IF_PROTO_STEP_8 : size);
return (size >= offset ? offset : size);
} }
virtual int parseIdentity(Message *message, const unsigned char *buffer, virtual int parseIdentity(Message *message, const unsigned char *buffer,
......
...@@ -209,11 +209,7 @@ class CupsChannel : public GenericChannel ...@@ -209,11 +209,7 @@ class CupsChannel : public GenericChannel
virtual int isCompressed() virtual int isCompressed()
{ {
if (control -> isProtoStep8() == 0) // Since ProtoStep8 (#issue 108)
{
return 1;
}
return 0; return 0;
} }
...@@ -252,11 +248,7 @@ class SmbChannel : public GenericChannel ...@@ -252,11 +248,7 @@ class SmbChannel : public GenericChannel
virtual int isCompressed() virtual int isCompressed()
{ {
if (control -> isProtoStep8() == 0) // Since ProtoStep8 (#issue 108)
{
return 1;
}
return 0; return 0;
} }
...@@ -344,11 +336,7 @@ class HttpChannel : public GenericChannel ...@@ -344,11 +336,7 @@ class HttpChannel : public GenericChannel
virtual int isCompressed() virtual int isCompressed()
{ {
if (control -> isProtoStep8() == 0) // Since ProtoStep8 (#issue 108)
{
return 1;
}
return 0; return 0;
} }
...@@ -387,11 +375,7 @@ class FontChannel : public GenericChannel ...@@ -387,11 +375,7 @@ class FontChannel : public GenericChannel
virtual int isCompressed() virtual int isCompressed()
{ {
if (control -> isProtoStep8() == 0) // Since ProtoStep8 (#issue 108)
{
return 1;
}
return 0; return 0;
} }
......
...@@ -45,12 +45,9 @@ GenericReplyStore::GenericReplyStore(StaticCompressor *compressor) ...@@ -45,12 +45,9 @@ GenericReplyStore::GenericReplyStore(StaticCompressor *compressor)
enableCache = GENERICREPLY_ENABLE_CACHE; enableCache = GENERICREPLY_ENABLE_CACHE;
enableData = GENERICREPLY_ENABLE_DATA; enableData = GENERICREPLY_ENABLE_DATA;
enableSplit = GENERICREPLY_ENABLE_SPLIT; enableSplit = GENERICREPLY_ENABLE_SPLIT;
enableCompress = GENERICREPLY_ENABLE_COMPRESS;
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
enableCompress = GENERICREPLY_ENABLE_COMPRESS_IF_PROTO_STEP_7; enableCompress = GENERICREPLY_ENABLE_COMPRESS_IF_PROTO_STEP_7;
}
dataLimit = GENERICREPLY_DATA_LIMIT; dataLimit = GENERICREPLY_DATA_LIMIT;
dataOffset = GENERICREPLY_DATA_OFFSET; dataOffset = GENERICREPLY_DATA_OFFSET;
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#define GENERICREPLY_ENABLE_CACHE 1 #define GENERICREPLY_ENABLE_CACHE 1
#define GENERICREPLY_ENABLE_DATA 1 #define GENERICREPLY_ENABLE_DATA 1
#define GENERICREPLY_ENABLE_SPLIT 0 #define GENERICREPLY_ENABLE_SPLIT 0
#define GENERICREPLY_ENABLE_COMPRESS 1
#define GENERICREPLY_DATA_LIMIT 1048576 - 32 #define GENERICREPLY_DATA_LIMIT 1048576 - 32
#define GENERICREPLY_DATA_OFFSET 32 #define GENERICREPLY_DATA_OFFSET 32
......
...@@ -45,15 +45,10 @@ GenericRequestStore::GenericRequestStore(StaticCompressor *compressor) ...@@ -45,15 +45,10 @@ GenericRequestStore::GenericRequestStore(StaticCompressor *compressor)
enableCache = GENERICREQUEST_ENABLE_CACHE; enableCache = GENERICREQUEST_ENABLE_CACHE;
enableData = GENERICREQUEST_ENABLE_DATA; enableData = GENERICREQUEST_ENABLE_DATA;
enableSplit = GENERICREQUEST_ENABLE_SPLIT; enableSplit = GENERICREQUEST_ENABLE_SPLIT;
enableCompress = GENERICREQUEST_ENABLE_COMPRESS;
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
enableCompress = GENERICREQUEST_ENABLE_COMPRESS_IF_PROTO_STEP_7; enableCompress = GENERICREQUEST_ENABLE_COMPRESS_IF_PROTO_STEP_7;
enableCompress = 0;
}
dataLimit = GENERICREQUEST_DATA_LIMIT; dataLimit = GENERICREQUEST_DATA_LIMIT;
dataOffset = GENERICREQUEST_DATA_OFFSET; dataOffset = GENERICREQUEST_DATA_OFFSET;
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#define GENERICREQUEST_ENABLE_CACHE 1 #define GENERICREQUEST_ENABLE_CACHE 1
#define GENERICREQUEST_ENABLE_DATA 1 #define GENERICREQUEST_ENABLE_DATA 1
#define GENERICREQUEST_ENABLE_SPLIT 0 #define GENERICREQUEST_ENABLE_SPLIT 0
#define GENERICREQUEST_ENABLE_COMPRESS 1
#define GENERICREQUEST_DATA_LIMIT 262144 - 20 #define GENERICREQUEST_DATA_LIMIT 262144 - 20
#define GENERICREQUEST_DATA_OFFSET 20 #define GENERICREQUEST_DATA_OFFSET 20
......
...@@ -43,12 +43,9 @@ GetImageReplyStore::GetImageReplyStore(StaticCompressor *compressor) ...@@ -43,12 +43,9 @@ GetImageReplyStore::GetImageReplyStore(StaticCompressor *compressor)
enableCache = GETIMAGEREPLY_ENABLE_CACHE; enableCache = GETIMAGEREPLY_ENABLE_CACHE;
enableData = GETIMAGEREPLY_ENABLE_DATA; enableData = GETIMAGEREPLY_ENABLE_DATA;
enableSplit = GETIMAGEREPLY_ENABLE_SPLIT; enableSplit = GETIMAGEREPLY_ENABLE_SPLIT;
enableCompress = GETIMAGEREPLY_ENABLE_COMPRESS;
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
enableCompress = GETIMAGEREPLY_ENABLE_COMPRESS_IF_PROTO_STEP_7; enableCompress = GETIMAGEREPLY_ENABLE_COMPRESS_IF_PROTO_STEP_7;
}
dataLimit = GETIMAGEREPLY_DATA_LIMIT; dataLimit = GETIMAGEREPLY_DATA_LIMIT;
dataOffset = GETIMAGEREPLY_DATA_OFFSET; dataOffset = GETIMAGEREPLY_DATA_OFFSET;
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#define GETIMAGEREPLY_ENABLE_CACHE 1 #define GETIMAGEREPLY_ENABLE_CACHE 1
#define GETIMAGEREPLY_ENABLE_DATA 1 #define GETIMAGEREPLY_ENABLE_DATA 1
#define GETIMAGEREPLY_ENABLE_SPLIT 0 #define GETIMAGEREPLY_ENABLE_SPLIT 0
#define GETIMAGEREPLY_ENABLE_COMPRESS 1
#define GETIMAGEREPLY_DATA_LIMIT 1048576 - 32 #define GETIMAGEREPLY_DATA_LIMIT 1048576 - 32
#define GETIMAGEREPLY_DATA_OFFSET 32 #define GETIMAGEREPLY_DATA_OFFSET 32
......
...@@ -45,12 +45,9 @@ GetPropertyReplyStore::GetPropertyReplyStore(StaticCompressor *compressor) ...@@ -45,12 +45,9 @@ GetPropertyReplyStore::GetPropertyReplyStore(StaticCompressor *compressor)
enableCache = GETPROPERTYREPLY_ENABLE_CACHE; enableCache = GETPROPERTYREPLY_ENABLE_CACHE;
enableData = GETPROPERTYREPLY_ENABLE_DATA; enableData = GETPROPERTYREPLY_ENABLE_DATA;
enableSplit = GETPROPERTYREPLY_ENABLE_SPLIT; enableSplit = GETPROPERTYREPLY_ENABLE_SPLIT;
enableCompress = GETPROPERTYREPLY_ENABLE_COMPRESS;
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
enableCompress = GETPROPERTYREPLY_ENABLE_COMPRESS_IF_PROTO_STEP_7; enableCompress = GETPROPERTYREPLY_ENABLE_COMPRESS_IF_PROTO_STEP_7;
}
dataLimit = GETPROPERTYREPLY_DATA_LIMIT; dataLimit = GETPROPERTYREPLY_DATA_LIMIT;
dataOffset = GETPROPERTYREPLY_DATA_OFFSET; dataOffset = GETPROPERTYREPLY_DATA_OFFSET;
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#define GETPROPERTYREPLY_ENABLE_CACHE 1 #define GETPROPERTYREPLY_ENABLE_CACHE 1
#define GETPROPERTYREPLY_ENABLE_DATA 1 #define GETPROPERTYREPLY_ENABLE_DATA 1
#define GETPROPERTYREPLY_ENABLE_SPLIT 0 #define GETPROPERTYREPLY_ENABLE_SPLIT 0
#define GETPROPERTYREPLY_ENABLE_COMPRESS 1
#define GETPROPERTYREPLY_DATA_LIMIT 1048576 - 32 #define GETPROPERTYREPLY_DATA_LIMIT 1048576 - 32
#define GETPROPERTYREPLY_DATA_OFFSET 32 #define GETPROPERTYREPLY_DATA_OFFSET 32
......
...@@ -39,12 +39,9 @@ ListFontsReplyStore::ListFontsReplyStore(StaticCompressor *compressor) ...@@ -39,12 +39,9 @@ ListFontsReplyStore::ListFontsReplyStore(StaticCompressor *compressor)
enableCache = LISTFONTSREPLY_ENABLE_CACHE; enableCache = LISTFONTSREPLY_ENABLE_CACHE;
enableData = LISTFONTSREPLY_ENABLE_DATA; enableData = LISTFONTSREPLY_ENABLE_DATA;
enableSplit = LISTFONTSREPLY_ENABLE_SPLIT; enableSplit = LISTFONTSREPLY_ENABLE_SPLIT;
enableCompress = LISTFONTSREPLY_ENABLE_COMPRESS;
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
enableCompress = LISTFONTSREPLY_ENABLE_COMPRESS_IF_PROTO_STEP_7; enableCompress = LISTFONTSREPLY_ENABLE_COMPRESS_IF_PROTO_STEP_7;
}
dataLimit = LISTFONTSREPLY_DATA_LIMIT; dataLimit = LISTFONTSREPLY_DATA_LIMIT;
dataOffset = LISTFONTSREPLY_DATA_OFFSET; dataOffset = LISTFONTSREPLY_DATA_OFFSET;
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#define LISTFONTSREPLY_ENABLE_CACHE 1 #define LISTFONTSREPLY_ENABLE_CACHE 1
#define LISTFONTSREPLY_ENABLE_DATA 1 #define LISTFONTSREPLY_ENABLE_DATA 1
#define LISTFONTSREPLY_ENABLE_SPLIT 0 #define LISTFONTSREPLY_ENABLE_SPLIT 0
#define LISTFONTSREPLY_ENABLE_COMPRESS 1
#define LISTFONTSREPLY_DATA_LIMIT 1048576 - 32 #define LISTFONTSREPLY_DATA_LIMIT 1048576 - 32
#define LISTFONTSREPLY_DATA_OFFSET 32 #define LISTFONTSREPLY_DATA_OFFSET 32
......
...@@ -113,20 +113,6 @@ MessageStore::MessageStore(StaticCompressor *compressor) ...@@ -113,20 +113,6 @@ MessageStore::MessageStore(StaticCompressor *compressor)
lastAction = is_discarded; lastAction = is_discarded;
// //
// This is used only for compatibility
// with older proxies.
//
if (control -> isProtoStep7() == 1)
{
lastResize = -1;
}
else
{
lastResize = 0;
}
//
// Private members. // Private members.
// //
......
...@@ -30,9 +30,6 @@ ...@@ -30,9 +30,6 @@
#include "ActionCache.h" #include "ActionCache.h"
#include "ActionCacheCompat.h"
#include "PositionCacheCompat.h"
#include "StaticCompressor.h" #include "StaticCompressor.h"
// //
...@@ -346,16 +343,6 @@ class MessageStore ...@@ -346,16 +343,6 @@ class MessageStore
ActionCache lastActionCache; ActionCache lastActionCache;
// //
// Used in old protocol versions.
//
ActionCacheCompat lastActionCacheCompat;
PositionCacheCompat lastAddedCacheCompat;
PositionCacheCompat lastHitCacheCompat;
PositionCacheCompat lastRemovedCacheCompat;
//
// Position in cache where next insertion // Position in cache where next insertion
// is going to take place. // is going to take place.
// //
...@@ -363,14 +350,6 @@ class MessageStore ...@@ -363,14 +350,6 @@ class MessageStore
short int lastRated; short int lastRated;
// //
// Size of data part of last split message
// once compressed. This is used only for
// compatibility with older proxies.
//
int lastResize;
//
// Constructors and destructors. // Constructors and destructors.
// //
......
...@@ -93,10 +93,8 @@ void PolyLineStore::dumpIdentity(const Message *message) const ...@@ -93,10 +93,8 @@ void PolyLineStore::dumpIdentity(const Message *message) const
void PolyLineStore::identityChecksum(const Message *message, const unsigned char *buffer, void PolyLineStore::identityChecksum(const Message *message, const unsigned char *buffer,
unsigned int size, int bigEndian) const unsigned int size, int bigEndian) const
{ {
if (control -> isProtoStep8() == 1) // Since ProtoStep8 (#issue 108)
{
md5_append(md5_state_, buffer + 1, 1); md5_append(md5_state_, buffer + 1, 1);
}
} }
void PolyLineStore::updateIdentity(EncodeBuffer &encodeBuffer, const Message *message, void PolyLineStore::updateIdentity(EncodeBuffer &encodeBuffer, const Message *message,
...@@ -108,11 +106,6 @@ void PolyLineStore::updateIdentity(EncodeBuffer &encodeBuffer, const Message *me ...@@ -108,11 +106,6 @@ void PolyLineStore::updateIdentity(EncodeBuffer &encodeBuffer, const Message *me
ClientCache *clientCache = (ClientCache *) channelCache; ClientCache *clientCache = (ClientCache *) channelCache;
if (control -> isProtoStep8() == 0)
{
encodeBuffer.encodeBoolValue((unsigned int) polyLine -> mode);
}
#ifdef TEST #ifdef TEST
*logofs << name() << ": Encoding value " << polyLine -> drawable *logofs << name() << ": Encoding value " << polyLine -> drawable
<< " as drawable field.\n" << logofs_flush; << " as drawable field.\n" << logofs_flush;
...@@ -141,13 +134,6 @@ void PolyLineStore::updateIdentity(DecodeBuffer &decodeBuffer, const Message *me ...@@ -141,13 +134,6 @@ void PolyLineStore::updateIdentity(DecodeBuffer &decodeBuffer, const Message *me
unsigned int value; unsigned int value;
if (control -> isProtoStep8() == 0)
{
decodeBuffer.decodeBoolValue(value);
polyLine -> mode = value;
}
decodeBuffer.decodeXidValue(value, clientCache -> drawableCache); decodeBuffer.decodeXidValue(value, clientCache -> drawableCache);
polyLine -> drawable = value; polyLine -> drawable = value;
......
...@@ -93,10 +93,8 @@ void PolyPointStore::dumpIdentity(const Message *message) const ...@@ -93,10 +93,8 @@ void PolyPointStore::dumpIdentity(const Message *message) const
void PolyPointStore::identityChecksum(const Message *message, const unsigned char *buffer, void PolyPointStore::identityChecksum(const Message *message, const unsigned char *buffer,
unsigned int size, int bigEndian) const unsigned int size, int bigEndian) const
{ {
if (control -> isProtoStep8() == 1) // Since ProtoStep8 (#issue 108)
{
md5_append(md5_state_, buffer + 1, 1); md5_append(md5_state_, buffer + 1, 1);
}
} }
void PolyPointStore::updateIdentity(EncodeBuffer &encodeBuffer, const Message *message, void PolyPointStore::updateIdentity(EncodeBuffer &encodeBuffer, const Message *message,
...@@ -108,11 +106,6 @@ void PolyPointStore::updateIdentity(EncodeBuffer &encodeBuffer, const Message *m ...@@ -108,11 +106,6 @@ void PolyPointStore::updateIdentity(EncodeBuffer &encodeBuffer, const Message *m
ClientCache *clientCache = (ClientCache *) channelCache; ClientCache *clientCache = (ClientCache *) channelCache;
if (control -> isProtoStep8() == 0)
{
encodeBuffer.encodeBoolValue((unsigned int) polyPoint -> mode);
}
#ifdef TEST #ifdef TEST
*logofs << name() << ": Encoding value " << polyPoint -> drawable *logofs << name() << ": Encoding value " << polyPoint -> drawable
<< " as drawable field.\n" << logofs_flush; << " as drawable field.\n" << logofs_flush;
...@@ -141,13 +134,6 @@ void PolyPointStore::updateIdentity(DecodeBuffer &decodeBuffer, const Message *m ...@@ -141,13 +134,6 @@ void PolyPointStore::updateIdentity(DecodeBuffer &decodeBuffer, const Message *m
unsigned int value; unsigned int value;
if (control -> isProtoStep8() == 0)
{
decodeBuffer.decodeBoolValue(value);
polyPoint -> mode = value;
}
decodeBuffer.decodeXidValue(value, clientCache -> drawableCache); decodeBuffer.decodeXidValue(value, clientCache -> drawableCache);
polyPoint -> drawable = value; polyPoint -> drawable = value;
......
...@@ -21,25 +21,8 @@ ...@@ -21,25 +21,8 @@
PositionCacheCompat::PositionCacheCompat() PositionCacheCompat::PositionCacheCompat()
{ {
if (control -> isProtoStep7() == 0)
{
for (int i = 0; i < 32; i++)
{
base_[i] = new IntCache(8);
}
slot_ = 0;
last_ = 0;
}
} }
PositionCacheCompat::~PositionCacheCompat() PositionCacheCompat::~PositionCacheCompat()
{ {
if (control -> isProtoStep7() == 0)
{
for (int i = 0; i < 32; i++)
{
delete base_[i];
}
}
} }
...@@ -244,22 +244,6 @@ Proxy::Proxy(int fd) ...@@ -244,22 +244,6 @@ Proxy::Proxy(int fd)
clientStore_ = new ClientStore(compressor_); clientStore_ = new ClientStore(compressor_);
serverStore_ = new ServerStore(compressor_); serverStore_ = new ServerStore(compressor_);
//
// Older proxies will refuse to store
// messages bigger than 262144 bytes.
//
if (control -> isProtoStep7() == 0)
{
#ifdef TEST
*logofs << "Proxy: WARNING! Limiting the maximum "
<< "message size to " << 262144 << ".\n"
<< logofs_flush;
#endif
control -> MaximumMessageSize = 262144;
}
clientCache_ = new ClientCache(); clientCache_ = new ClientCache();
serverCache_ = new ServerCache(); serverCache_ = new ServerCache();
...@@ -3049,8 +3033,7 @@ int Proxy::handleCloseAllXConnections() ...@@ -3049,8 +3033,7 @@ int Proxy::handleCloseAllXConnections()
int Proxy::handleCloseAllListeners() int Proxy::handleCloseAllListeners()
{ {
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
if (finish_ == 0) if (finish_ == 0)
{ {
#ifdef TEST #ifdef TEST
...@@ -3065,17 +3048,6 @@ int Proxy::handleCloseAllListeners() ...@@ -3065,17 +3048,6 @@ int Proxy::handleCloseAllListeners()
finish_ = 1; finish_ = 1;
} }
}
else
{
#ifdef TEST
*logofs << "Proxy: WARNING! Not sending unsupported "
<< "'code_finish_listeners' message.\n"
<< logofs_flush;
#endif
finish_ = 1;
}
return 1; return 1;
} }
...@@ -4546,16 +4518,9 @@ int Proxy::addTokenCodes(T_proxy_token &token) ...@@ -4546,16 +4518,9 @@ int Proxy::addTokenCodes(T_proxy_token &token)
int count = 0; int count = 0;
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
count = token.bytes / token.size; count = token.bytes / token.size;
if (count > 255)
{
count = 255;
}
}
// //
// Force a count of 1, for example // Force a count of 1, for example
// if this is a ping. // if this is a ping.
...@@ -4569,6 +4534,12 @@ int Proxy::addTokenCodes(T_proxy_token &token) ...@@ -4569,6 +4534,12 @@ int Proxy::addTokenCodes(T_proxy_token &token)
} }
else else
{ {
// Since ProtoStep7 (#issue 108)
if (count > 255)
{
count = 255;
}
// //
// Let the next token account for the // Let the next token account for the
// remaining bytes. // remaining bytes.
...@@ -4609,9 +4580,10 @@ int Proxy::handleToken(T_frame_type type) ...@@ -4609,9 +4580,10 @@ int Proxy::handleToken(T_frame_type type)
if (type == frame_data) if (type == frame_data)
{ {
if (control -> isProtoStep7() == 1)
{
// //
// Since ProtoStep7 (#issue 108)
//
// Send a distinct token for each data type. // Send a distinct token for each data type.
// We don't want to slow down the sending of // We don't want to slow down the sending of
// the X events, X replies and split confir- // the X events, X replies and split confir-
...@@ -4687,39 +4659,6 @@ int Proxy::handleToken(T_frame_type type) ...@@ -4687,39 +4659,6 @@ int Proxy::handleToken(T_frame_type type)
} }
else else
{ {
//
// Sum everything to the control token.
//
if (control -> ProxyMode == proxy_client)
{
statistics -> updateControlToken(tokens_[token_control].bytes);
statistics -> updateSplitToken(tokens_[token_control].bytes);
statistics -> updateDataToken(tokens_[token_control].bytes);
if (tokens_[token_control].bytes > tokens_[token_control].size)
{
if (addTokenCodes(tokens_[token_control]) < 0)
{
return -1;
}
#if defined(TEST) || defined(INFO) || defined(TOKEN)
T_proxy_token &token = tokens_[token_control];
*logofs << "Proxy: TOKEN! Token class ["
<< DumpToken(token.type) << "] has now "
<< token.bytes << " bytes accumulated and "
<< token.remaining << " tokens remaining.\n"
<< logofs_flush;
#endif
}
}
}
}
else
{
if (addTokenCodes(tokens_[token_control]) < 0) if (addTokenCodes(tokens_[token_control]) < 0)
{ {
return -1; return -1;
...@@ -4777,21 +4716,10 @@ int Proxy::handleTokenFromProxy(T_proxy_token &token, int count) ...@@ -4777,21 +4716,10 @@ int Proxy::handleTokenFromProxy(T_proxy_token &token, int count)
<< count << ".\n" << logofs_flush; << count << ".\n" << logofs_flush;
#endif #endif
if (control -> isProtoStep7() == 0) //
{ // Since ProtoStep7 (#issue 108) with no limitations
if (control -> ProxyMode == proxy_client || // concerning invalid token requests at this point
token.request != code_control_token_request) //
{
#ifdef PANIC
*logofs << "Proxy: PANIC! Invalid token request received from remote.\n"
<< logofs_flush;
#endif
cerr << "Error" << ": Invalid token request received from remote.\n";
HandleCleanup();
}
}
// //
// Add our token reply. // Add our token reply.
...@@ -4815,25 +4743,13 @@ int Proxy::handleTokenReplyFromProxy(T_proxy_token &token, int count) ...@@ -4815,25 +4743,13 @@ int Proxy::handleTokenReplyFromProxy(T_proxy_token &token, int count)
#endif #endif
// //
// Increment the available tokens. // Since ProtoStep7 (#issue 108) with no limitations
// concerning invalid token requests at this point
// //
if (control -> isProtoStep7() == 0) //
{ // Increment the available tokens.
if (token.reply != code_control_token_reply) //
{
#ifdef PANIC
*logofs << "Proxy: PANIC! Invalid token reply received from remote.\n"
<< logofs_flush;
#endif
cerr << "Error" << ": Invalid token reply received from remote.\n";
HandleCleanup();
}
count = 1;
}
token.remaining += count; token.remaining += count;
...@@ -4924,24 +4840,10 @@ void Proxy::handleFailOnLoad(const char *fullName, const char *failContext) cons ...@@ -4924,24 +4840,10 @@ void Proxy::handleFailOnLoad(const char *fullName, const char *failContext) cons
int Proxy::handleSaveVersion(unsigned char *buffer, int &major, int Proxy::handleSaveVersion(unsigned char *buffer, int &major,
int &minor, int &patch) const int &minor, int &patch) const
{ {
if (control -> isProtoStep8() == 1) // Since ProtoStep8 (#issue 108)
{
major = 3; major = 3;
minor = 0; minor = 0;
patch = 0; patch = 0;
}
else if (control -> isProtoStep7() == 1)
{
major = 2;
minor = 0;
patch = 0;
}
else
{
major = 1;
minor = 4;
patch = 0;
}
*(buffer + 0) = major; *(buffer + 0) = major;
*(buffer + 1) = minor; *(buffer + 1) = minor;
...@@ -4964,27 +4866,11 @@ int Proxy::handleLoadVersion(const unsigned char *buffer, int &major, ...@@ -4964,27 +4866,11 @@ int Proxy::handleLoadVersion(const unsigned char *buffer, int &major,
// incompatible caches. // incompatible caches.
// //
if (control -> isProtoStep8() == 1) // Since ProtoStep8 (#issue 108)
{
if (major < 3) if (major < 3)
{ {
return -1; return -1;
} }
}
else if (control -> isProtoStep7() == 1)
{
if (major < 2)
{
return -1;
}
}
else
{
if (major != 1 && minor != 4)
{
return -1;
}
}
return 1; return 1;
} }
...@@ -6109,20 +5995,8 @@ int Proxy::handleNewGenericConnection(int clientFd, T_channel_type type, const c ...@@ -6109,20 +5995,8 @@ int Proxy::handleNewGenericConnection(int clientFd, T_channel_type type, const c
int Proxy::handleNewSlaveConnection(int clientFd) int Proxy::handleNewSlaveConnection(int clientFd)
{ {
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
return handleNewGenericConnection(clientFd, channel_slave, "slave"); return handleNewGenericConnection(clientFd, channel_slave, "slave");
}
else
{
#ifdef TEST
*logofs << "Proxy: WARNING! Not sending unsupported "
<< "'code_new_slave_connection' message.\n"
<< logofs_flush;
#endif
return -1;
}
} }
int Proxy::handleNewGenericConnectionFromProxy(int channelId, T_channel_type type, int Proxy::handleNewGenericConnectionFromProxy(int channelId, T_channel_type type,
......
...@@ -767,11 +767,6 @@ class Proxy ...@@ -767,11 +767,6 @@ class Proxy
handleSplitEvent(encodeBuffer_, split); handleSplitEvent(encodeBuffer_, split);
} }
int handleAsyncInit()
{
return handleFlush();
}
int handleAsyncPriority() int handleAsyncPriority()
{ {
if (control -> FlushPriority == 1) if (control -> FlushPriority == 1)
......
...@@ -44,13 +44,9 @@ PutImageStore::PutImageStore(StaticCompressor *compressor) ...@@ -44,13 +44,9 @@ PutImageStore::PutImageStore(StaticCompressor *compressor)
{ {
enableCache = PUTIMAGE_ENABLE_CACHE; enableCache = PUTIMAGE_ENABLE_CACHE;
enableData = PUTIMAGE_ENABLE_DATA; enableData = PUTIMAGE_ENABLE_DATA;
enableSplit = PUTIMAGE_ENABLE_SPLIT;
enableCompress = PUTIMAGE_ENABLE_COMPRESS;
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
enableCompress = PUTIMAGE_ENABLE_COMPRESS_IF_PROTO_STEP_7; enableCompress = PUTIMAGE_ENABLE_COMPRESS_IF_PROTO_STEP_7;
}
dataLimit = PUTIMAGE_DATA_LIMIT; dataLimit = PUTIMAGE_DATA_LIMIT;
dataOffset = PUTIMAGE_DATA_OFFSET; dataOffset = PUTIMAGE_DATA_OFFSET;
...@@ -59,10 +55,8 @@ PutImageStore::PutImageStore(StaticCompressor *compressor) ...@@ -59,10 +55,8 @@ PutImageStore::PutImageStore(StaticCompressor *compressor)
cacheThreshold = PUTIMAGE_CACHE_THRESHOLD; cacheThreshold = PUTIMAGE_CACHE_THRESHOLD;
cacheLowerThreshold = PUTIMAGE_CACHE_LOWER_THRESHOLD; cacheLowerThreshold = PUTIMAGE_CACHE_LOWER_THRESHOLD;
if (control -> isProtoStep8() == 1) // Since ProtoStep8 (#issue 108)
{
enableSplit = PUTIMAGE_ENABLE_SPLIT_IF_PROTO_STEP_8; enableSplit = PUTIMAGE_ENABLE_SPLIT_IF_PROTO_STEP_8;
}
messages_ -> resize(cacheSlots); messages_ -> resize(cacheSlots);
......
...@@ -36,8 +36,6 @@ ...@@ -36,8 +36,6 @@
#define PUTIMAGE_ENABLE_CACHE 1 #define PUTIMAGE_ENABLE_CACHE 1
#define PUTIMAGE_ENABLE_DATA 1 #define PUTIMAGE_ENABLE_DATA 1
#define PUTIMAGE_ENABLE_SPLIT 1
#define PUTIMAGE_ENABLE_COMPRESS 1
#define PUTIMAGE_DATA_LIMIT 262144 - 24 #define PUTIMAGE_DATA_LIMIT 262144 - 24
#define PUTIMAGE_DATA_OFFSET 24 #define PUTIMAGE_DATA_OFFSET 24
......
...@@ -44,7 +44,6 @@ PutPackedImageStore::PutPackedImageStore(StaticCompressor *compressor) ...@@ -44,7 +44,6 @@ PutPackedImageStore::PutPackedImageStore(StaticCompressor *compressor)
{ {
enableCache = PUTPACKEDIMAGE_ENABLE_CACHE; enableCache = PUTPACKEDIMAGE_ENABLE_CACHE;
enableData = PUTPACKEDIMAGE_ENABLE_DATA; enableData = PUTPACKEDIMAGE_ENABLE_DATA;
enableSplit = PUTPACKEDIMAGE_ENABLE_SPLIT;
enableCompress = PUTPACKEDIMAGE_ENABLE_COMPRESS; enableCompress = PUTPACKEDIMAGE_ENABLE_COMPRESS;
dataLimit = PUTPACKEDIMAGE_DATA_LIMIT; dataLimit = PUTPACKEDIMAGE_DATA_LIMIT;
...@@ -54,10 +53,8 @@ PutPackedImageStore::PutPackedImageStore(StaticCompressor *compressor) ...@@ -54,10 +53,8 @@ PutPackedImageStore::PutPackedImageStore(StaticCompressor *compressor)
cacheThreshold = PUTPACKEDIMAGE_CACHE_THRESHOLD; cacheThreshold = PUTPACKEDIMAGE_CACHE_THRESHOLD;
cacheLowerThreshold = PUTPACKEDIMAGE_CACHE_LOWER_THRESHOLD; cacheLowerThreshold = PUTPACKEDIMAGE_CACHE_LOWER_THRESHOLD;
if (control -> isProtoStep8() == 1) // Since ProtoStep8 (#issue 108)
{
enableSplit = PUTPACKEDIMAGE_ENABLE_SPLIT_IF_PROTO_STEP_8; enableSplit = PUTPACKEDIMAGE_ENABLE_SPLIT_IF_PROTO_STEP_8;
}
messages_ -> resize(cacheSlots); messages_ -> resize(cacheSlots);
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#define PUTPACKEDIMAGE_ENABLE_CACHE 1 #define PUTPACKEDIMAGE_ENABLE_CACHE 1
#define PUTPACKEDIMAGE_ENABLE_DATA 1 #define PUTPACKEDIMAGE_ENABLE_DATA 1
#define PUTPACKEDIMAGE_ENABLE_SPLIT 1
#define PUTPACKEDIMAGE_ENABLE_COMPRESS 0 #define PUTPACKEDIMAGE_ENABLE_COMPRESS 0
// //
......
...@@ -39,12 +39,9 @@ QueryFontReplyStore::QueryFontReplyStore(StaticCompressor *compressor) ...@@ -39,12 +39,9 @@ QueryFontReplyStore::QueryFontReplyStore(StaticCompressor *compressor)
enableCache = QUERYFONTREPLY_ENABLE_CACHE; enableCache = QUERYFONTREPLY_ENABLE_CACHE;
enableData = QUERYFONTREPLY_ENABLE_DATA; enableData = QUERYFONTREPLY_ENABLE_DATA;
enableSplit = QUERYFONTREPLY_ENABLE_SPLIT; enableSplit = QUERYFONTREPLY_ENABLE_SPLIT;
enableCompress = QUERYFONTREPLY_ENABLE_COMPRESS;
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
enableCompress = QUERYFONTREPLY_ENABLE_COMPRESS_IF_PROTO_STEP_7; enableCompress = QUERYFONTREPLY_ENABLE_COMPRESS_IF_PROTO_STEP_7;
}
dataLimit = QUERYFONTREPLY_DATA_LIMIT; dataLimit = QUERYFONTREPLY_DATA_LIMIT;
dataOffset = QUERYFONTREPLY_DATA_OFFSET; dataOffset = QUERYFONTREPLY_DATA_OFFSET;
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#define QUERYFONTREPLY_ENABLE_CACHE 1 #define QUERYFONTREPLY_ENABLE_CACHE 1
#define QUERYFONTREPLY_ENABLE_DATA 1 #define QUERYFONTREPLY_ENABLE_DATA 1
#define QUERYFONTREPLY_ENABLE_SPLIT 0 #define QUERYFONTREPLY_ENABLE_SPLIT 0
#define QUERYFONTREPLY_ENABLE_COMPRESS 1
#define QUERYFONTREPLY_DATA_LIMIT 1048576 - 32 #define QUERYFONTREPLY_DATA_LIMIT 1048576 - 32
#define QUERYFONTREPLY_DATA_OFFSET 8 #define QUERYFONTREPLY_DATA_OFFSET 8
......
...@@ -102,8 +102,7 @@ MESSAGE_BEGIN_ENCODE_MESSAGE ...@@ -102,8 +102,7 @@ MESSAGE_BEGIN_ENCODE_MESSAGE
unsigned int src_x = GetUINT(buffer + 24, bigEndian); unsigned int src_x = GetUINT(buffer + 24, bigEndian);
unsigned int src_y = GetUINT(buffer + 26, bigEndian); unsigned int src_y = GetUINT(buffer + 26, bigEndian);
if (control -> isProtoStep8() == 1) // Since ProtoStep8 (#issue 108)
{
encodeBuffer.encodeDiffCachedValue(src_x, encodeBuffer.encodeDiffCachedValue(src_x,
clientCache -> renderGlyphX, 16, clientCache -> renderGlyphX, 16,
clientCache -> renderGlyphXCache, 11); clientCache -> renderGlyphXCache, 11);
...@@ -111,17 +110,6 @@ MESSAGE_BEGIN_ENCODE_MESSAGE ...@@ -111,17 +110,6 @@ MESSAGE_BEGIN_ENCODE_MESSAGE
encodeBuffer.encodeDiffCachedValue(src_y, encodeBuffer.encodeDiffCachedValue(src_y,
clientCache -> renderGlyphY, 16, clientCache -> renderGlyphY, 16,
clientCache -> renderGlyphYCache, 11); clientCache -> renderGlyphYCache, 11);
}
else
{
encodeBuffer.encodeDiffCachedValue(src_x,
clientCache -> renderLastX, 16,
clientCache -> renderXCache, 11);
encodeBuffer.encodeDiffCachedValue(src_y,
clientCache -> renderLastY, 16,
clientCache -> renderYCache, 11);
}
#ifdef TEST #ifdef TEST
*logofs << name() << ": Encoded source X " *logofs << name() << ": Encoded source X "
...@@ -147,8 +135,8 @@ MESSAGE_BEGIN_ENCODE_MESSAGE ...@@ -147,8 +135,8 @@ MESSAGE_BEGIN_ENCODE_MESSAGE
// tive to the first offset coordinates. // tive to the first offset coordinates.
// //
if (control -> isProtoStep8() == 1 && // Since ProtoStep8 (#issue 108)
size >= MESSAGE_OFFSET_IF_PROTO_STEP_8) if (size >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
{ {
unsigned int numGlyphs = *(buffer + 28); unsigned int numGlyphs = *(buffer + 28);
...@@ -232,8 +220,7 @@ MESSAGE_BEGIN_DECODE_MESSAGE ...@@ -232,8 +220,7 @@ MESSAGE_BEGIN_DECODE_MESSAGE
unsigned int src_x; unsigned int src_x;
unsigned int src_y; unsigned int src_y;
if (control -> isProtoStep8() == 1) // Since ProtoStep8 (#issue 108)
{
decodeBuffer.decodeDiffCachedValue(src_x, decodeBuffer.decodeDiffCachedValue(src_x,
clientCache -> renderGlyphX, 16, clientCache -> renderGlyphX, 16,
clientCache -> renderGlyphXCache, 11); clientCache -> renderGlyphXCache, 11);
...@@ -241,23 +228,12 @@ MESSAGE_BEGIN_DECODE_MESSAGE ...@@ -241,23 +228,12 @@ MESSAGE_BEGIN_DECODE_MESSAGE
decodeBuffer.decodeDiffCachedValue(src_y, decodeBuffer.decodeDiffCachedValue(src_y,
clientCache -> renderGlyphY, 16, clientCache -> renderGlyphY, 16,
clientCache -> renderGlyphYCache, 11); clientCache -> renderGlyphYCache, 11);
}
else
{
decodeBuffer.decodeDiffCachedValue(src_x,
clientCache -> renderLastX, 16,
clientCache -> renderXCache, 11);
decodeBuffer.decodeDiffCachedValue(src_y,
clientCache -> renderLastY, 16,
clientCache -> renderYCache, 11);
}
PutUINT(src_x, buffer + 24, bigEndian); PutUINT(src_x, buffer + 24, bigEndian);
PutUINT(src_y, buffer + 26, bigEndian); PutUINT(src_y, buffer + 26, bigEndian);
if (control -> isProtoStep8() == 1 && // Since ProtoStep8 (#issue 108)
size >= MESSAGE_OFFSET_IF_PROTO_STEP_8) if (size >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
{ {
decodeBuffer.decodeCachedValue(value, 8, decodeBuffer.decodeCachedValue(value, 8,
clientCache -> renderNumGlyphsCache); clientCache -> renderNumGlyphsCache);
...@@ -297,8 +273,8 @@ MESSAGE_END_DECODE_MESSAGE ...@@ -297,8 +273,8 @@ MESSAGE_END_DECODE_MESSAGE
MESSAGE_BEGIN_ENCODE_DATA MESSAGE_BEGIN_ENCODE_DATA
{ {
if (control -> isProtoStep8() == 1 && // Since ProtoStep8 (#issue 108)
size >= MESSAGE_OFFSET_IF_PROTO_STEP_8) if (size >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
{ {
encodeCharData(encodeBuffer, buffer, MESSAGE_OFFSET_IF_PROTO_STEP_8, encodeCharData(encodeBuffer, buffer, MESSAGE_OFFSET_IF_PROTO_STEP_8,
size, bigEndian, channelCache); size, bigEndian, channelCache);
...@@ -318,8 +294,8 @@ MESSAGE_END_ENCODE_DATA ...@@ -318,8 +294,8 @@ MESSAGE_END_ENCODE_DATA
MESSAGE_BEGIN_DECODE_DATA MESSAGE_BEGIN_DECODE_DATA
{ {
if (control -> isProtoStep8() == 1 && // Since ProtoStep8 (#issue 108)
size >= MESSAGE_OFFSET_IF_PROTO_STEP_8) if (size >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
{ {
decodeCharData(decodeBuffer, buffer, MESSAGE_OFFSET_IF_PROTO_STEP_8, decodeCharData(decodeBuffer, buffer, MESSAGE_OFFSET_IF_PROTO_STEP_8,
size, bigEndian, channelCache); size, bigEndian, channelCache);
...@@ -353,8 +329,8 @@ MESSAGE_BEGIN_PARSE_IDENTITY ...@@ -353,8 +329,8 @@ MESSAGE_BEGIN_PARSE_IDENTITY
renderExtension -> data.composite_glyphs.src_x = GetUINT(buffer + 24, bigEndian); renderExtension -> data.composite_glyphs.src_x = GetUINT(buffer + 24, bigEndian);
renderExtension -> data.composite_glyphs.src_y = GetUINT(buffer + 26, bigEndian); renderExtension -> data.composite_glyphs.src_y = GetUINT(buffer + 26, bigEndian);
if (control -> isProtoStep8() == 1 && // Since ProtoStep8 (#issue 108)
size >= MESSAGE_OFFSET_IF_PROTO_STEP_8) if (size >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
{ {
renderExtension -> data.composite_glyphs.num_elm = *(buffer + 28); renderExtension -> data.composite_glyphs.num_elm = *(buffer + 28);
...@@ -387,8 +363,8 @@ MESSAGE_BEGIN_UNPARSE_IDENTITY ...@@ -387,8 +363,8 @@ MESSAGE_BEGIN_UNPARSE_IDENTITY
PutUINT(renderExtension -> data.composite_glyphs.src_x, buffer + 24, bigEndian); PutUINT(renderExtension -> data.composite_glyphs.src_x, buffer + 24, bigEndian);
PutUINT(renderExtension -> data.composite_glyphs.src_y, buffer + 26, bigEndian); PutUINT(renderExtension -> data.composite_glyphs.src_y, buffer + 26, bigEndian);
if (control -> isProtoStep8() == 1 && // Since ProtoStep8 (#issue 108)
size >= MESSAGE_OFFSET_IF_PROTO_STEP_8) if (size >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
{ {
*(buffer + 28) = renderExtension -> data.composite_glyphs.num_elm; *(buffer + 28) = renderExtension -> data.composite_glyphs.num_elm;
...@@ -426,8 +402,8 @@ MESSAGE_BEGIN_IDENTITY_CHECKSUM ...@@ -426,8 +402,8 @@ MESSAGE_BEGIN_IDENTITY_CHECKSUM
// first string. // first string.
// //
if (control -> isProtoStep8() == 1 && // Since ProtoStep8 (#issue 108)
size >= MESSAGE_OFFSET_IF_PROTO_STEP_8) if (size >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
{ {
md5_append(md5_state, buffer + 28, 1); md5_append(md5_state, buffer + 28, 1);
} }
...@@ -470,8 +446,7 @@ MESSAGE_BEGIN_ENCODE_UPDATE ...@@ -470,8 +446,7 @@ MESSAGE_BEGIN_ENCODE_UPDATE
unsigned int value; unsigned int value;
unsigned int previous; unsigned int previous;
if (control -> isProtoStep8() == 1) // Since ProtoStep8 (#issue 108)
{
value = renderExtension -> data.composite_glyphs.src_x; value = renderExtension -> data.composite_glyphs.src_x;
previous = cachedRenderExtension -> data.composite_glyphs.src_x; previous = cachedRenderExtension -> data.composite_glyphs.src_x;
...@@ -487,25 +462,6 @@ MESSAGE_BEGIN_ENCODE_UPDATE ...@@ -487,25 +462,6 @@ MESSAGE_BEGIN_ENCODE_UPDATE
clientCache -> renderGlyphYCache, 11); clientCache -> renderGlyphYCache, 11);
cachedRenderExtension -> data.composite_glyphs.src_y = value; cachedRenderExtension -> data.composite_glyphs.src_y = value;
}
else
{
value = renderExtension -> data.composite_glyphs.src_x;
previous = cachedRenderExtension -> data.composite_glyphs.src_x;
encodeBuffer.encodeDiffCachedValue(value, previous, 16,
clientCache -> renderXCache, 11);
cachedRenderExtension -> data.composite_glyphs.src_x = value;
value = renderExtension -> data.composite_glyphs.src_y;
previous = cachedRenderExtension -> data.composite_glyphs.src_y;
encodeBuffer.encodeDiffCachedValue(value, previous, 16,
clientCache -> renderYCache, 11);
cachedRenderExtension -> data.composite_glyphs.src_y = value;
}
#ifdef TEST #ifdef TEST
*logofs << name() << ": Encoded source X " *logofs << name() << ": Encoded source X "
...@@ -514,8 +470,8 @@ MESSAGE_BEGIN_ENCODE_UPDATE ...@@ -514,8 +470,8 @@ MESSAGE_BEGIN_ENCODE_UPDATE
<< logofs_flush; << logofs_flush;
#endif #endif
if (control -> isProtoStep8() == 1 && // Since ProtoStep8 (#issue 108)
renderExtension -> size_ >= MESSAGE_OFFSET_IF_PROTO_STEP_8) if (renderExtension -> size_ >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
{ {
// //
// Offset X and Y. // Offset X and Y.
...@@ -601,8 +557,7 @@ MESSAGE_BEGIN_DECODE_UPDATE ...@@ -601,8 +557,7 @@ MESSAGE_BEGIN_DECODE_UPDATE
unsigned int value; unsigned int value;
unsigned int previous; unsigned int previous;
if (control -> isProtoStep8() == 1) // Since ProtoStep8 (#issue 108)
{
previous = renderExtension -> data.composite_glyphs.src_x; previous = renderExtension -> data.composite_glyphs.src_x;
decodeBuffer.decodeDiffCachedValue(value, previous, 16, decodeBuffer.decodeDiffCachedValue(value, previous, 16,
...@@ -616,26 +571,9 @@ MESSAGE_BEGIN_DECODE_UPDATE ...@@ -616,26 +571,9 @@ MESSAGE_BEGIN_DECODE_UPDATE
clientCache -> renderGlyphYCache, 11); clientCache -> renderGlyphYCache, 11);
renderExtension -> data.composite_glyphs.src_y = value; renderExtension -> data.composite_glyphs.src_y = value;
}
else
{
previous = renderExtension -> data.composite_glyphs.src_x;
decodeBuffer.decodeDiffCachedValue(value, previous, 16,
clientCache -> renderXCache, 11);
renderExtension -> data.composite_glyphs.src_x = value;
previous = renderExtension -> data.composite_glyphs.src_y;
decodeBuffer.decodeDiffCachedValue(value, previous, 16,
clientCache -> renderYCache, 11);
renderExtension -> data.composite_glyphs.src_y = value;
}
if (control -> isProtoStep8() == 1 && // Since ProtoStep8 (#issue 108)
renderExtension -> size_ >= MESSAGE_OFFSET_IF_PROTO_STEP_8) if (renderExtension -> size_ >= MESSAGE_OFFSET_IF_PROTO_STEP_8)
{ {
// //
// Offset X and Y. // Offset X and Y.
......
...@@ -80,9 +80,8 @@ class MESSAGE_STORE : public MESSAGE_CLASS ...@@ -80,9 +80,8 @@ class MESSAGE_STORE : public MESSAGE_CLASS
virtual int identitySize(const unsigned char *buffer, virtual int identitySize(const unsigned char *buffer,
unsigned int size) unsigned int size)
{ {
unsigned int offset = (control -> isProtoStep8() == 1 ? // Since ProtoStep8 (#issue 108)
MESSAGE_OFFSET_IF_PROTO_STEP_8 : unsigned int offset = MESSAGE_OFFSET_IF_PROTO_STEP_8;
MESSAGE_OFFSET);
return (size >= offset ? offset : size); return (size >= offset ? offset : size);
} }
......
...@@ -42,13 +42,6 @@ ...@@ -42,13 +42,6 @@
#include "RenderTrapezoids.h" #include "RenderTrapezoids.h"
#include "RenderTriangles.h" #include "RenderTriangles.h"
#include "RenderCreatePictureCompat.h"
#include "RenderFreePictureCompat.h"
#include "RenderPictureClipCompat.h"
#include "RenderCreateGlyphSetCompat.h"
#include "RenderCompositeCompat.h"
#include "RenderCompositeGlyphsCompat.h"
// //
// Set the verbosity level. // Set the verbosity level.
// //
...@@ -82,8 +75,7 @@ RenderExtensionStore::RenderExtensionStore(StaticCompressor *compressor) ...@@ -82,8 +75,7 @@ RenderExtensionStore::RenderExtensionStore(StaticCompressor *compressor)
minors_[X_RenderFillRectangles] = new RenderFillRectanglesStore(); minors_[X_RenderFillRectangles] = new RenderFillRectanglesStore();
minors_[X_RenderAddGlyphs] = new RenderAddGlyphsStore(); minors_[X_RenderAddGlyphs] = new RenderAddGlyphsStore();
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
minors_[X_RenderCreatePicture] = new RenderCreatePictureStore(); minors_[X_RenderCreatePicture] = new RenderCreatePictureStore();
minors_[X_RenderFreePicture] = new RenderFreePictureStore(); minors_[X_RenderFreePicture] = new RenderFreePictureStore();
minors_[X_RenderSetPictureClipRectangles] = new RenderPictureClipStore(); minors_[X_RenderSetPictureClipRectangles] = new RenderPictureClipStore();
...@@ -98,30 +90,12 @@ RenderExtensionStore::RenderExtensionStore(StaticCompressor *compressor) ...@@ -98,30 +90,12 @@ RenderExtensionStore::RenderExtensionStore(StaticCompressor *compressor)
minors_[X_RenderFreeGlyphSet] = new RenderFreeGlyphSetStore(); minors_[X_RenderFreeGlyphSet] = new RenderFreeGlyphSetStore();
minors_[X_RenderTrapezoids] = new RenderTrapezoidsStore(); minors_[X_RenderTrapezoids] = new RenderTrapezoidsStore();
minors_[X_RenderTriangles] = new RenderTrianglesStore(); minors_[X_RenderTriangles] = new RenderTrianglesStore();
}
else
{
minors_[X_RenderCreatePicture] = new RenderCreatePictureCompatStore();
minors_[X_RenderFreePicture] = new RenderFreePictureCompatStore();
minors_[X_RenderSetPictureClipRectangles] = new RenderPictureClipCompatStore();
minors_[X_RenderCreateGlyphSet] = new RenderCreateGlyphSetCompatStore();
minors_[X_RenderComposite] = new RenderCompositeCompatStore();
minors_[X_RenderCompositeGlyphs8] = new RenderCompositeGlyphsCompatStore();
minors_[X_RenderCompositeGlyphs16] = new RenderCompositeGlyphsCompatStore();
minors_[X_RenderCompositeGlyphs32] = new RenderCompositeGlyphsCompatStore();
}
dataLimit = RENDEREXTENSION_DATA_LIMIT; dataLimit = RENDEREXTENSION_DATA_LIMIT;
dataOffset = RENDEREXTENSION_DATA_OFFSET; dataOffset = RENDEREXTENSION_DATA_OFFSET;
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
cacheSlots = RENDEREXTENSION_CACHE_SLOTS_IF_PROTO_STEP_7; cacheSlots = RENDEREXTENSION_CACHE_SLOTS_IF_PROTO_STEP_7;
}
else
{
cacheSlots = RENDEREXTENSION_CACHE_SLOTS;
}
cacheThreshold = RENDEREXTENSION_CACHE_THRESHOLD; cacheThreshold = RENDEREXTENSION_CACHE_THRESHOLD;
cacheLowerThreshold = RENDEREXTENSION_CACHE_LOWER_THRESHOLD; cacheLowerThreshold = RENDEREXTENSION_CACHE_LOWER_THRESHOLD;
...@@ -268,204 +242,78 @@ void RenderMinorExtensionStore::encodeLongData(EncodeBuffer &encodeBuffer, const ...@@ -268,204 +242,78 @@ void RenderMinorExtensionStore::encodeLongData(EncodeBuffer &encodeBuffer, const
unsigned int offset, unsigned int size, int bigEndian, unsigned int offset, unsigned int size, int bigEndian,
ChannelCache *channelCache) const ChannelCache *channelCache) const
{ {
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
encodeBuffer.encodeLongData(buffer + offset, size - offset); encodeBuffer.encodeLongData(buffer + offset, size - offset);
#ifdef TEST #ifdef TEST
*logofs << name() << ": Encoded " << size - offset *logofs << name() << ": Encoded " << size - offset
<< " bytes of long data.\n" << logofs_flush; << " bytes of long data.\n" << logofs_flush;
#endif #endif
return;
}
ClientCache *clientCache = (ClientCache *) channelCache;
for (unsigned int i = offset, c = (offset - 4) % 16; i < size; i += 4)
{
#ifdef DEBUG
*logofs << name() << ": Encoding int with i = " << i << " c = "
<< c << ".\n" << logofs_flush;
#endif
encodeBuffer.encodeCachedValue(GetULONG(buffer + i, bigEndian), 32,
*clientCache -> renderDataCache[c]);
if (++c == 16) c = 0;
}
} }
void RenderMinorExtensionStore::encodeIntData(EncodeBuffer &encodeBuffer, const unsigned char *buffer, void RenderMinorExtensionStore::encodeIntData(EncodeBuffer &encodeBuffer, const unsigned char *buffer,
unsigned int offset, unsigned int size, int bigEndian, unsigned int offset, unsigned int size, int bigEndian,
ChannelCache *channelCache) const ChannelCache *channelCache) const
{ {
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
encodeBuffer.encodeIntData(buffer + offset, size - offset); encodeBuffer.encodeIntData(buffer + offset, size - offset);
#ifdef TEST #ifdef TEST
*logofs << name() << ": Encoded " << size - offset *logofs << name() << ": Encoded " << size - offset
<< " bytes of int data.\n" << logofs_flush; << " bytes of int data.\n" << logofs_flush;
#endif #endif
return;
}
ClientCache *clientCache = (ClientCache *) channelCache;
for (unsigned int i = offset, c = (offset - 4) % 16; i < size; i += 2)
{
#ifdef DEBUG
*logofs << name() << ": Encoding int with i = " << i << " c = "
<< c << ".\n" << logofs_flush;
#endif
encodeBuffer.encodeCachedValue(GetUINT(buffer + i, bigEndian), 16,
*clientCache -> renderDataCache[c]);
if (++c == 16) c = 0;
}
} }
void RenderMinorExtensionStore::encodeCharData(EncodeBuffer &encodeBuffer, const unsigned char *buffer, void RenderMinorExtensionStore::encodeCharData(EncodeBuffer &encodeBuffer, const unsigned char *buffer,
unsigned int offset, unsigned int size, int bigEndian, unsigned int offset, unsigned int size, int bigEndian,
ChannelCache *channelCache) const ChannelCache *channelCache) const
{ {
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
encodeBuffer.encodeTextData(buffer + offset, size - offset); encodeBuffer.encodeTextData(buffer + offset, size - offset);
#ifdef TEST #ifdef TEST
*logofs << name() << ": Encoded " << size - offset *logofs << name() << ": Encoded " << size - offset
<< " bytes of text data.\n" << logofs_flush; << " bytes of text data.\n" << logofs_flush;
#endif #endif
return;
}
ClientCache *clientCache = (ClientCache *) channelCache;
clientCache -> renderTextCompressor.reset();
const unsigned char *next = buffer + offset;
for (unsigned int i = offset; i < size; i++)
{
#ifdef DEBUG
*logofs << name() << ": Encoding char with i = " << i
<< ".\n" << logofs_flush;
#endif
clientCache -> renderTextCompressor.
encodeChar(*next++, encodeBuffer);
}
} }
void RenderMinorExtensionStore::decodeLongData(DecodeBuffer &decodeBuffer, unsigned char *buffer, void RenderMinorExtensionStore::decodeLongData(DecodeBuffer &decodeBuffer, unsigned char *buffer,
unsigned int offset, unsigned int size, int bigEndian, unsigned int offset, unsigned int size, int bigEndian,
ChannelCache *channelCache) const ChannelCache *channelCache) const
{ {
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
decodeBuffer.decodeLongData(buffer + offset, size - offset); decodeBuffer.decodeLongData(buffer + offset, size - offset);
#ifdef TEST #ifdef TEST
*logofs << name() << ": Decoded " << size - offset *logofs << name() << ": Decoded " << size - offset
<< " bytes of long data.\n" << logofs_flush; << " bytes of long data.\n" << logofs_flush;
#endif #endif
return;
}
ClientCache *clientCache = (ClientCache *) channelCache;
unsigned int value;
for (unsigned int i = offset, c = (offset - 4) % 16; i < size; i += 4)
{
#ifdef DEBUG
*logofs << name() << ": Decoding int with i = " << i << " c = "
<< c << ".\n" << logofs_flush;
#endif
decodeBuffer.decodeCachedValue(value, 32,
*clientCache -> renderDataCache[c]);
PutULONG(value, buffer + i, bigEndian);
if (++c == 16) c = 0;
}
} }
void RenderMinorExtensionStore::decodeIntData(DecodeBuffer &decodeBuffer, unsigned char *buffer, void RenderMinorExtensionStore::decodeIntData(DecodeBuffer &decodeBuffer, unsigned char *buffer,
unsigned int offset, unsigned int size, int bigEndian, unsigned int offset, unsigned int size, int bigEndian,
ChannelCache *channelCache) const ChannelCache *channelCache) const
{ {
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
decodeBuffer.decodeIntData(buffer + offset, size - offset); decodeBuffer.decodeIntData(buffer + offset, size - offset);
#ifdef TEST #ifdef TEST
*logofs << name() << ": Decoded " << size - offset *logofs << name() << ": Decoded " << size - offset
<< " bytes of int data.\n" << logofs_flush; << " bytes of int data.\n" << logofs_flush;
#endif #endif
return;
}
ClientCache *clientCache = (ClientCache *) channelCache;
unsigned int value;
for (unsigned int i = offset, c = (offset - 4) % 16; i < size; i += 2)
{
#ifdef DEBUG
*logofs << name() << ": Decoding int with i = " << i << " c = "
<< c << ".\n" << logofs_flush;
#endif
decodeBuffer.decodeCachedValue(value, 16,
*clientCache -> renderDataCache[c]);
PutUINT(value, buffer + i, bigEndian);
if (++c == 16) c = 0;
}
} }
void RenderMinorExtensionStore::decodeCharData(DecodeBuffer &decodeBuffer, unsigned char *buffer, void RenderMinorExtensionStore::decodeCharData(DecodeBuffer &decodeBuffer, unsigned char *buffer,
unsigned int offset, unsigned int size, int bigEndian, unsigned int offset, unsigned int size, int bigEndian,
ChannelCache *channelCache) const ChannelCache *channelCache) const
{ {
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
decodeBuffer.decodeTextData(buffer + offset, size - offset); decodeBuffer.decodeTextData(buffer + offset, size - offset);
#ifdef TEST #ifdef TEST
*logofs << name() << ": Decoded " << size - offset *logofs << name() << ": Decoded " << size - offset
<< " bytes of text data.\n" << logofs_flush; << " bytes of text data.\n" << logofs_flush;
#endif #endif
return;
}
ClientCache *clientCache = (ClientCache *) channelCache;
clientCache -> renderTextCompressor.reset();
unsigned char *next = buffer + offset;
for (unsigned int i = offset; i < size; i++)
{
#ifdef DEBUG
*logofs << name() << ": Decoding char with i = " << i
<< ".\n" << logofs_flush;
#endif
*next++ = clientCache -> renderTextCompressor.
decodeChar(decodeBuffer);
}
} }
void RenderMinorExtensionStore::parseIntData(const Message *message, const unsigned char *buffer, void RenderMinorExtensionStore::parseIntData(const Message *message, const unsigned char *buffer,
......
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
#define RENDEREXTENSION_DATA_LIMIT 6144 #define RENDEREXTENSION_DATA_LIMIT 6144
#define RENDEREXTENSION_DATA_OFFSET 36 #define RENDEREXTENSION_DATA_OFFSET 36
#define RENDEREXTENSION_CACHE_SLOTS 6000
#define RENDEREXTENSION_CACHE_THRESHOLD 20 #define RENDEREXTENSION_CACHE_THRESHOLD 20
#define RENDEREXTENSION_CACHE_LOWER_THRESHOLD 10 #define RENDEREXTENSION_CACHE_LOWER_THRESHOLD 10
......
...@@ -71,7 +71,6 @@ ServerCache::ServerCache() : ...@@ -71,7 +71,6 @@ ServerCache::ServerCache() :
getKeyboardMappingKeysymCache(8), getKeyboardMappingKeysymCache(8),
getPropertyTypeCache(8), getPropertyTypeCache(8),
getPropertyTextCompressor(textCache, SERVER_TEXT_CACHE_SIZE),
getSelectionOwnerCache(8), getSelectionOwnerCache(8),
...@@ -85,9 +84,7 @@ ServerCache::ServerCache() : ...@@ -85,9 +84,7 @@ ServerCache::ServerCache() :
translateCoordsChildCache(8), translateCoordsXCache(8), translateCoordsChildCache(8), translateCoordsXCache(8),
translateCoordsYCache(8), translateCoordsYCache(8),
queryTreeWindowCache(8), queryTreeWindowCache(8)
getAtomNameTextCompressor(textCache, SERVER_TEXT_CACHE_SIZE)
{ {
unsigned int i; unsigned int i;
......
...@@ -215,7 +215,6 @@ class ServerCache : public ChannelCache ...@@ -215,7 +215,6 @@ class ServerCache : public ChannelCache
CharCache getPropertyFormatCache; CharCache getPropertyFormatCache;
IntCache getPropertyTypeCache; IntCache getPropertyTypeCache;
TextCompressor getPropertyTextCompressor;
static BlockCache xResources; static BlockCache xResources;
// //
...@@ -273,13 +272,6 @@ class ServerCache : public ChannelCache ...@@ -273,13 +272,6 @@ class ServerCache : public ChannelCache
IntCache queryTreeWindowCache; IntCache queryTreeWindowCache;
// //
// GetAtomName reply in protocol
// versions >= 3.
//
TextCompressor getAtomNameTextCompressor;
//
// Generic reply. Use short data // Generic reply. Use short data
// in protocol versions >= 3. // in protocol versions >= 3.
// //
......
...@@ -312,21 +312,6 @@ class ServerChannel : public Channel ...@@ -312,21 +312,6 @@ class ServerChannel : public Channel
int handleSplitChecksum(DecodeBuffer &decodeBuffer, T_checksum &checksum); int handleSplitChecksum(DecodeBuffer &decodeBuffer, T_checksum &checksum);
void handleSplitEnable()
{
if (control -> isProtoStep7() == 0)
{
#if defined(TEST) || defined(SPLIT)
*logofs << "handleSplitEnable: WARNING! Disabling load "
<< "and save with an old proxy version.\n"
<< logofs_flush;
#endif
splitState_.save = 0;
splitState_.load = 0;
}
}
// //
// Allocate and free the shared memory // Allocate and free the shared memory
// support resources. // support resources.
......
...@@ -102,15 +102,9 @@ class ServerProxy : public Proxy ...@@ -102,15 +102,9 @@ class ServerProxy : public Proxy
virtual int checkLocalChannelMap(int channelId) virtual int checkLocalChannelMap(int channelId)
{ {
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
return ((channelId & control -> ChannelMask) == 0); return ((channelId & control -> ChannelMask) == 0);
} }
else
{
return 0;
}
}
private: private:
......
...@@ -44,7 +44,6 @@ SetUnpackAlphaStore::SetUnpackAlphaStore(StaticCompressor *compressor) ...@@ -44,7 +44,6 @@ SetUnpackAlphaStore::SetUnpackAlphaStore(StaticCompressor *compressor)
{ {
enableCache = SETUNPACKALPHA_ENABLE_CACHE; enableCache = SETUNPACKALPHA_ENABLE_CACHE;
enableData = SETUNPACKALPHA_ENABLE_DATA; enableData = SETUNPACKALPHA_ENABLE_DATA;
enableSplit = SETUNPACKALPHA_ENABLE_SPLIT_IF_PROTO_STEP_7;
enableCompress = SETUNPACKALPHA_ENABLE_COMPRESS_IF_PROTO_STEP_7; enableCompress = SETUNPACKALPHA_ENABLE_COMPRESS_IF_PROTO_STEP_7;
dataLimit = SETUNPACKALPHA_DATA_LIMIT; dataLimit = SETUNPACKALPHA_DATA_LIMIT;
...@@ -54,10 +53,8 @@ SetUnpackAlphaStore::SetUnpackAlphaStore(StaticCompressor *compressor) ...@@ -54,10 +53,8 @@ SetUnpackAlphaStore::SetUnpackAlphaStore(StaticCompressor *compressor)
cacheThreshold = SETUNPACKALPHA_CACHE_THRESHOLD; cacheThreshold = SETUNPACKALPHA_CACHE_THRESHOLD;
cacheLowerThreshold = SETUNPACKALPHA_CACHE_LOWER_THRESHOLD; cacheLowerThreshold = SETUNPACKALPHA_CACHE_LOWER_THRESHOLD;
if (control -> isProtoStep8() == 1) // Since ProtoStep8 (#issue 108)
{
enableSplit = SETUNPACKALPHA_ENABLE_SPLIT_IF_PROTO_STEP_8; enableSplit = SETUNPACKALPHA_ENABLE_SPLIT_IF_PROTO_STEP_8;
}
messages_ -> resize(cacheSlots); messages_ -> resize(cacheSlots);
......
...@@ -36,18 +36,14 @@ ...@@ -36,18 +36,14 @@
#define SETUNPACKALPHA_ENABLE_CACHE 1 #define SETUNPACKALPHA_ENABLE_CACHE 1
#define SETUNPACKALPHA_ENABLE_DATA 1 #define SETUNPACKALPHA_ENABLE_DATA 1
#define SETUNPACKALPHA_ENABLE_SPLIT 0
#define SETUNPACKALPHA_ENABLE_COMPRESS 1
#define SETUNPACKALPHA_DATA_LIMIT 16384 #define SETUNPACKALPHA_DATA_LIMIT 16384
#define SETUNPACKALPHA_DATA_OFFSET 8
#define SETUNPACKALPHA_CACHE_SLOTS 2000 #define SETUNPACKALPHA_CACHE_SLOTS 2000
#define SETUNPACKALPHA_CACHE_THRESHOLD 10 #define SETUNPACKALPHA_CACHE_THRESHOLD 10
#define SETUNPACKALPHA_CACHE_LOWER_THRESHOLD 5 #define SETUNPACKALPHA_CACHE_LOWER_THRESHOLD 5
#define SETUNPACKALPHA_DATA_OFFSET_IF_PROTO_STEP_7 16 #define SETUNPACKALPHA_DATA_OFFSET_IF_PROTO_STEP_7 16
#define SETUNPACKALPHA_ENABLE_SPLIT_IF_PROTO_STEP_7 1
#define SETUNPACKALPHA_ENABLE_COMPRESS_IF_PROTO_STEP_7 0 #define SETUNPACKALPHA_ENABLE_COMPRESS_IF_PROTO_STEP_7 0
#define SETUNPACKALPHA_ENABLE_SPLIT_IF_PROTO_STEP_8 0 #define SETUNPACKALPHA_ENABLE_SPLIT_IF_PROTO_STEP_8 0
......
...@@ -44,7 +44,6 @@ SetUnpackColormapStore::SetUnpackColormapStore(StaticCompressor *compressor) ...@@ -44,7 +44,6 @@ SetUnpackColormapStore::SetUnpackColormapStore(StaticCompressor *compressor)
{ {
enableCache = SETUNPACKCOLORMAP_ENABLE_CACHE; enableCache = SETUNPACKCOLORMAP_ENABLE_CACHE;
enableData = SETUNPACKCOLORMAP_ENABLE_DATA; enableData = SETUNPACKCOLORMAP_ENABLE_DATA;
enableSplit = SETUNPACKCOLORMAP_ENABLE_SPLIT;
enableCompress = SETUNPACKCOLORMAP_ENABLE_COMPRESS_IF_PROTO_STEP_7; enableCompress = SETUNPACKCOLORMAP_ENABLE_COMPRESS_IF_PROTO_STEP_7;
dataLimit = SETUNPACKCOLORMAP_DATA_LIMIT; dataLimit = SETUNPACKCOLORMAP_DATA_LIMIT;
...@@ -54,10 +53,8 @@ SetUnpackColormapStore::SetUnpackColormapStore(StaticCompressor *compressor) ...@@ -54,10 +53,8 @@ SetUnpackColormapStore::SetUnpackColormapStore(StaticCompressor *compressor)
cacheThreshold = SETUNPACKCOLORMAP_CACHE_THRESHOLD; cacheThreshold = SETUNPACKCOLORMAP_CACHE_THRESHOLD;
cacheLowerThreshold = SETUNPACKCOLORMAP_CACHE_LOWER_THRESHOLD; cacheLowerThreshold = SETUNPACKCOLORMAP_CACHE_LOWER_THRESHOLD;
if (control -> isProtoStep8() == 1) // Since ProtoStep8 (#issue 108)
{
enableSplit = SETUNPACKCOLORMAP_ENABLE_SPLIT_IF_PROTO_STEP_8; enableSplit = SETUNPACKCOLORMAP_ENABLE_SPLIT_IF_PROTO_STEP_8;
}
messages_ -> resize(cacheSlots); messages_ -> resize(cacheSlots);
......
...@@ -36,11 +36,8 @@ ...@@ -36,11 +36,8 @@
#define SETUNPACKCOLORMAP_ENABLE_CACHE 1 #define SETUNPACKCOLORMAP_ENABLE_CACHE 1
#define SETUNPACKCOLORMAP_ENABLE_DATA 1 #define SETUNPACKCOLORMAP_ENABLE_DATA 1
#define SETUNPACKCOLORMAP_ENABLE_SPLIT 1
#define SETUNPACKCOLORMAP_ENABLE_COMPRESS 1
#define SETUNPACKCOLORMAP_DATA_LIMIT 4096 #define SETUNPACKCOLORMAP_DATA_LIMIT 4096
#define SETUNPACKCOLORMAP_DATA_OFFSET 8
#define SETUNPACKCOLORMAP_CACHE_SLOTS 2000 #define SETUNPACKCOLORMAP_CACHE_SLOTS 2000
#define SETUNPACKCOLORMAP_CACHE_THRESHOLD 5 #define SETUNPACKCOLORMAP_CACHE_THRESHOLD 5
......
...@@ -45,12 +45,9 @@ ShapeExtensionStore::ShapeExtensionStore(StaticCompressor *compressor) ...@@ -45,12 +45,9 @@ ShapeExtensionStore::ShapeExtensionStore(StaticCompressor *compressor)
enableCache = SHAPEEXTENSION_ENABLE_CACHE; enableCache = SHAPEEXTENSION_ENABLE_CACHE;
enableData = SHAPEEXTENSION_ENABLE_DATA; enableData = SHAPEEXTENSION_ENABLE_DATA;
enableSplit = SHAPEEXTENSION_ENABLE_SPLIT; enableSplit = SHAPEEXTENSION_ENABLE_SPLIT;
enableCompress = SHAPEEXTENSION_ENABLE_COMPRESS;
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
enableCompress = SHAPEEXTENSION_ENABLE_COMPRESS_IF_PROTO_STEP_7; enableCompress = SHAPEEXTENSION_ENABLE_COMPRESS_IF_PROTO_STEP_7;
}
dataLimit = SHAPEEXTENSION_DATA_LIMIT; dataLimit = SHAPEEXTENSION_DATA_LIMIT;
dataOffset = SHAPEEXTENSION_DATA_OFFSET; dataOffset = SHAPEEXTENSION_DATA_OFFSET;
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#define SHAPEEXTENSION_ENABLE_CACHE 1 #define SHAPEEXTENSION_ENABLE_CACHE 1
#define SHAPEEXTENSION_ENABLE_DATA 1 #define SHAPEEXTENSION_ENABLE_DATA 1
#define SHAPEEXTENSION_ENABLE_SPLIT 0 #define SHAPEEXTENSION_ENABLE_SPLIT 0
#define SHAPEEXTENSION_ENABLE_COMPRESS 1
#define SHAPEEXTENSION_DATA_LIMIT 3200 #define SHAPEEXTENSION_DATA_LIMIT 3200
#define SHAPEEXTENSION_DATA_OFFSET 20 #define SHAPEEXTENSION_DATA_OFFSET 20
......
...@@ -748,27 +748,8 @@ int SplitStore::start(DecodeBuffer &decodeBuffer) ...@@ -748,27 +748,8 @@ int SplitStore::start(DecodeBuffer &decodeBuffer)
// Get the compressed size. // Get the compressed size.
// //
if (control -> isProtoStep7() == 1) // Since ProtoStep7 (#issue 108)
{
decodeBuffer.decodeValue(compressedSize, 32, 14); decodeBuffer.decodeValue(compressedSize, 32, 14);
}
else
{
//
// As we can't refuse to handle the decoding
// of the split message when connected to an
// old proxy version, we need to decode this
// in a way that is compatible.
//
unsigned int diffSize;
decodeBuffer.decodeValue(diffSize, 32, 14);
split -> store_ -> lastResize += diffSize;
compressedSize = split -> store_ -> lastResize;
}
split -> store_ -> validateSize(split -> d_size_, compressedSize); split -> store_ -> validateSize(split -> d_size_, compressedSize);
......
...@@ -199,18 +199,18 @@ T_buffer; ...@@ -199,18 +199,18 @@ T_buffer;
// received at the decoding side. // received at the decoding side.
// //
// Since ProtoStep8 (#issue 108)
enum T_store_action enum T_store_action
{ {
is_hit, is_hit,
is_added, is_added,
is_discarded, is_discarded,
is_removed, is_removed
is_added_compat = 0,
is_hit_compat = 1
}; };
#define IS_HIT (control -> isProtoStep8() == 1 ? is_hit : is_hit_compat) // Since ProtoStep8 (#issue 108)
#define IS_ADDED (control -> isProtoStep8() == 1 ? is_added : is_added_compat) #define IS_HIT is_hit
#define IS_ADDED is_added
enum T_checksum_action enum T_checksum_action
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment