Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
03b65211
Unverified
Commit
03b65211
authored
Apr 19, 2016
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fcarvajaldev-3.6.x-remove-old-proto-compat' into 3.6.x
parents
2ffe52c5
5c495241
Hide whitespace changes
Inline
Side-by-side
Showing
86 changed files
with
650 additions
and
6620 deletions
+650
-6620
copyright.in
debian/copyright.in
+0
-25
nxcomp-3.6-drops-compat-code-3.4.x-testing.pdf
doc/nxcomp/nxcomp-3.6-drops-compat-code-3.4.x-testing.pdf
+0
-0
ActionCacheCompat.h
nxcomp/ActionCacheCompat.h
+0
-45
ChangeGCCompat.cpp
nxcomp/ChangeGCCompat.cpp
+0
-131
ChangeGCCompat.h
nxcomp/ChangeGCCompat.h
+0
-170
Channel.cpp
nxcomp/Channel.cpp
+44
-142
ChannelCache.h
nxcomp/ChannelCache.h
+0
-7
ClientCache.cpp
nxcomp/ClientCache.cpp
+0
-9
ClientCache.h
nxcomp/ClientCache.h
+0
-20
ClientChannel.cpp
nxcomp/ClientChannel.cpp
+75
-450
ClientChannel.h
nxcomp/ClientChannel.h
+0
-40
ClientProxy.h
nxcomp/ClientProxy.h
+2
-8
ClientStore.cpp
nxcomp/ClientStore.cpp
+5
-19
Control.cpp
nxcomp/Control.cpp
+23
-84
Control.h
nxcomp/Control.h
+25
-25
CreateGC.cpp
nxcomp/CreateGC.cpp
+18
-62
CreatePixmapCompat.cpp
nxcomp/CreatePixmapCompat.cpp
+0
-272
CreatePixmapCompat.h
nxcomp/CreatePixmapCompat.h
+0
-154
DecodeBuffer.cpp
nxcomp/DecodeBuffer.cpp
+15
-80
DecodeBuffer.h
nxcomp/DecodeBuffer.h
+0
-12
EncodeBuffer.cpp
nxcomp/EncodeBuffer.cpp
+9
-58
EncodeBuffer.h
nxcomp/EncodeBuffer.h
+0
-12
FillPoly.cpp
nxcomp/FillPoly.cpp
+8
-8
FillPoly.h
nxcomp/FillPoly.h
+5
-11
GenericChannel.h
nxcomp/GenericChannel.h
+4
-20
GenericReply.cpp
nxcomp/GenericReply.cpp
+2
-5
GenericReply.h
nxcomp/GenericReply.h
+0
-1
GenericRequest.cpp
nxcomp/GenericRequest.cpp
+2
-7
GenericRequest.h
nxcomp/GenericRequest.h
+0
-1
GetImageReply.cpp
nxcomp/GetImageReply.cpp
+2
-5
GetImageReply.h
nxcomp/GetImageReply.h
+0
-1
GetPropertyReply.cpp
nxcomp/GetPropertyReply.cpp
+2
-5
GetPropertyReply.h
nxcomp/GetPropertyReply.h
+0
-1
ListFontsReply.cpp
nxcomp/ListFontsReply.cpp
+2
-5
ListFontsReply.h
nxcomp/ListFontsReply.h
+0
-1
Loop.cpp
nxcomp/Loop.cpp
+75
-189
Makefile.in
nxcomp/Makefile.in
+1
-13
Message.cpp
nxcomp/Message.cpp
+0
-14
Message.h
nxcomp/Message.h
+0
-21
PolyLine.cpp
nxcomp/PolyLine.cpp
+2
-16
PolyPoint.cpp
nxcomp/PolyPoint.cpp
+2
-16
PositionCacheCompat.cpp
nxcomp/PositionCacheCompat.cpp
+0
-45
PositionCacheCompat.h
nxcomp/PositionCacheCompat.h
+0
-41
Proxy.cpp
nxcomp/Proxy.cpp
+77
-203
Proxy.h
nxcomp/Proxy.h
+0
-5
PutImage.cpp
nxcomp/PutImage.cpp
+4
-10
PutImage.h
nxcomp/PutImage.h
+0
-2
PutPackedImage.cpp
nxcomp/PutPackedImage.cpp
+2
-5
PutPackedImage.h
nxcomp/PutPackedImage.h
+0
-1
QueryFontReply.cpp
nxcomp/QueryFontReply.cpp
+2
-5
QueryFontReply.h
nxcomp/QueryFontReply.h
+0
-1
RenderCompositeCompat.cpp
nxcomp/RenderCompositeCompat.cpp
+0
-320
RenderCompositeCompat.h
nxcomp/RenderCompositeCompat.h
+0
-80
RenderCompositeGlyphs.cpp
nxcomp/RenderCompositeGlyphs.cpp
+52
-114
RenderCompositeGlyphs.h
nxcomp/RenderCompositeGlyphs.h
+2
-3
RenderCompositeGlyphsCompat.cpp
nxcomp/RenderCompositeGlyphsCompat.cpp
+0
-602
RenderCompositeGlyphsCompat.h
nxcomp/RenderCompositeGlyphsCompat.h
+0
-80
RenderCreateGlyphSetCompat.cpp
nxcomp/RenderCreateGlyphSetCompat.cpp
+0
-231
RenderCreateGlyphSetCompat.h
nxcomp/RenderCreateGlyphSetCompat.h
+0
-80
RenderCreatePictureCompat.cpp
nxcomp/RenderCreatePictureCompat.cpp
+0
-262
RenderCreatePictureCompat.h
nxcomp/RenderCreatePictureCompat.h
+0
-80
RenderExtension.cpp
nxcomp/RenderExtension.cpp
+53
-205
RenderExtension.h
nxcomp/RenderExtension.h
+0
-8
RenderFreePictureCompat.cpp
nxcomp/RenderFreePictureCompat.cpp
+0
-158
RenderFreePictureCompat.h
nxcomp/RenderFreePictureCompat.h
+0
-80
RenderPictureClipCompat.cpp
nxcomp/RenderPictureClipCompat.cpp
+0
-237
RenderPictureClipCompat.h
nxcomp/RenderPictureClipCompat.h
+0
-80
ServerCache.cpp
nxcomp/ServerCache.cpp
+1
-4
ServerCache.h
nxcomp/ServerCache.h
+0
-10
ServerChannel.cpp
nxcomp/ServerChannel.cpp
+119
-495
ServerChannel.h
nxcomp/ServerChannel.h
+0
-15
ServerProxy.h
nxcomp/ServerProxy.h
+2
-8
SetUnpackAlpha.cpp
nxcomp/SetUnpackAlpha.cpp
+2
-5
SetUnpackAlpha.h
nxcomp/SetUnpackAlpha.h
+0
-4
SetUnpackAlphaCompat.cpp
nxcomp/SetUnpackAlphaCompat.cpp
+0
-250
SetUnpackAlphaCompat.h
nxcomp/SetUnpackAlphaCompat.h
+0
-149
SetUnpackColormap.cpp
nxcomp/SetUnpackColormap.cpp
+2
-5
SetUnpackColormap.h
nxcomp/SetUnpackColormap.h
+0
-3
SetUnpackColormapCompat.cpp
nxcomp/SetUnpackColormapCompat.cpp
+0
-262
SetUnpackColormapCompat.h
nxcomp/SetUnpackColormapCompat.h
+0
-149
ShapeExtension.cpp
nxcomp/ShapeExtension.cpp
+2
-5
ShapeExtension.h
nxcomp/ShapeExtension.h
+0
-1
Split.cpp
nxcomp/Split.cpp
+2
-21
TextCompressor.cpp
nxcomp/TextCompressor.cpp
+0
-77
TextCompressor.h
nxcomp/TextCompressor.h
+0
-49
Types.h
nxcomp/Types.h
+5
-5
No files found.
debian/copyright.in
View file @
03b65211
...
@@ -923,7 +923,6 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
...
@@ -923,7 +923,6 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
nx-X11/programs/Xserver/hw/nxagent/Windows.h
nx-X11/programs/Xserver/hw/nxagent/Windows.h
nxcomp/ActionCache.cpp
nxcomp/ActionCache.cpp
nxcomp/ActionCache.h
nxcomp/ActionCache.h
nxcomp/ActionCacheCompat.h
nxcomp/Agent.cpp
nxcomp/Agent.cpp
nxcomp/Agent.h
nxcomp/Agent.h
nxcomp/Alpha.cpp
nxcomp/Alpha.cpp
...
@@ -938,8 +937,6 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
...
@@ -938,8 +937,6 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
nxcomp/BlockCacheSet.h
nxcomp/BlockCacheSet.h
nxcomp/ChangeGC.cpp
nxcomp/ChangeGC.cpp
nxcomp/ChangeGC.h
nxcomp/ChangeGC.h
nxcomp/ChangeGCCompat.cpp
nxcomp/ChangeGCCompat.h
nxcomp/ChangeProperty.cpp
nxcomp/ChangeProperty.cpp
nxcomp/ChangeProperty.h
nxcomp/ChangeProperty.h
nxcomp/Channel.cpp
nxcomp/Channel.cpp
...
@@ -974,8 +971,6 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
...
@@ -974,8 +971,6 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
nxcomp/CreateGC.h
nxcomp/CreateGC.h
nxcomp/CreatePixmap.cpp
nxcomp/CreatePixmap.cpp
nxcomp/CreatePixmap.h
nxcomp/CreatePixmap.h
nxcomp/CreatePixmapCompat.cpp
nxcomp/CreatePixmapCompat.h
nxcomp/DecodeBuffer.cpp
nxcomp/DecodeBuffer.cpp
nxcomp/DecodeBuffer.h
nxcomp/DecodeBuffer.h
nxcomp/EncodeBuffer.cpp
nxcomp/EncodeBuffer.cpp
...
@@ -1053,8 +1048,6 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
...
@@ -1053,8 +1048,6 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
nxcomp/PolyText16.h
nxcomp/PolyText16.h
nxcomp/PolyText8.cpp
nxcomp/PolyText8.cpp
nxcomp/PolyText8.h
nxcomp/PolyText8.h
nxcomp/PositionCacheCompat.cpp
nxcomp/PositionCacheCompat.h
nxcomp/Proxy.cpp
nxcomp/Proxy.cpp
nxcomp/Proxy.h
nxcomp/Proxy.h
nxcomp/ProxyReadBuffer.cpp
nxcomp/ProxyReadBuffer.cpp
...
@@ -1073,20 +1066,12 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
...
@@ -1073,20 +1066,12 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
nxcomp/RenderChangePicture.h
nxcomp/RenderChangePicture.h
nxcomp/RenderComposite.cpp
nxcomp/RenderComposite.cpp
nxcomp/RenderComposite.h
nxcomp/RenderComposite.h
nxcomp/RenderCompositeCompat.cpp
nxcomp/RenderCompositeCompat.h
nxcomp/RenderCompositeGlyphs.cpp
nxcomp/RenderCompositeGlyphs.cpp
nxcomp/RenderCompositeGlyphs.h
nxcomp/RenderCompositeGlyphs.h
nxcomp/RenderCompositeGlyphsCompat.cpp
nxcomp/RenderCompositeGlyphsCompat.h
nxcomp/RenderCreateGlyphSet.cpp
nxcomp/RenderCreateGlyphSet.cpp
nxcomp/RenderCreateGlyphSet.h
nxcomp/RenderCreateGlyphSet.h
nxcomp/RenderCreateGlyphSetCompat.cpp
nxcomp/RenderCreateGlyphSetCompat.h
nxcomp/RenderCreatePicture.cpp
nxcomp/RenderCreatePicture.cpp
nxcomp/RenderCreatePicture.h
nxcomp/RenderCreatePicture.h
nxcomp/RenderCreatePictureCompat.cpp
nxcomp/RenderCreatePictureCompat.h
nxcomp/RenderExtension.cpp
nxcomp/RenderExtension.cpp
nxcomp/RenderExtension.h
nxcomp/RenderExtension.h
nxcomp/RenderFillRectangles.cpp
nxcomp/RenderFillRectangles.cpp
...
@@ -1095,8 +1080,6 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
...
@@ -1095,8 +1080,6 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
nxcomp/RenderFreeGlyphSet.h
nxcomp/RenderFreeGlyphSet.h
nxcomp/RenderFreePicture.cpp
nxcomp/RenderFreePicture.cpp
nxcomp/RenderFreePicture.h
nxcomp/RenderFreePicture.h
nxcomp/RenderFreePictureCompat.cpp
nxcomp/RenderFreePictureCompat.h
nxcomp/RenderGenericRequest.cpp
nxcomp/RenderGenericRequest.cpp
nxcomp/RenderGenericRequest.h
nxcomp/RenderGenericRequest.h
nxcomp/RenderMinorExtensionHeaders.h
nxcomp/RenderMinorExtensionHeaders.h
...
@@ -1104,8 +1087,6 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
...
@@ -1104,8 +1087,6 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
nxcomp/RenderMinorExtensionTags.h
nxcomp/RenderMinorExtensionTags.h
nxcomp/RenderPictureClip.cpp
nxcomp/RenderPictureClip.cpp
nxcomp/RenderPictureClip.h
nxcomp/RenderPictureClip.h
nxcomp/RenderPictureClipCompat.cpp
nxcomp/RenderPictureClipCompat.h
nxcomp/RenderPictureFilter.cpp
nxcomp/RenderPictureFilter.cpp
nxcomp/RenderPictureFilter.h
nxcomp/RenderPictureFilter.h
nxcomp/RenderPictureTransform.cpp
nxcomp/RenderPictureTransform.cpp
...
@@ -1136,12 +1117,8 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
...
@@ -1136,12 +1117,8 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
nxcomp/SetClipRectangles.h
nxcomp/SetClipRectangles.h
nxcomp/SetUnpackAlpha.cpp
nxcomp/SetUnpackAlpha.cpp
nxcomp/SetUnpackAlpha.h
nxcomp/SetUnpackAlpha.h
nxcomp/SetUnpackAlphaCompat.cpp
nxcomp/SetUnpackAlphaCompat.h
nxcomp/SetUnpackColormap.cpp
nxcomp/SetUnpackColormap.cpp
nxcomp/SetUnpackColormap.h
nxcomp/SetUnpackColormap.h
nxcomp/SetUnpackColormapCompat.cpp
nxcomp/SetUnpackColormapCompat.h
nxcomp/SetUnpackGeometry.cpp
nxcomp/SetUnpackGeometry.cpp
nxcomp/SetUnpackGeometry.h
nxcomp/SetUnpackGeometry.h
nxcomp/ShapeExtension.cpp
nxcomp/ShapeExtension.cpp
...
@@ -1154,8 +1131,6 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
...
@@ -1154,8 +1131,6 @@ Files: nx-X11/extras/Mesa/src/mesa/main/WSDrawBuffer.h
nxcomp/StaticCompressor.h
nxcomp/StaticCompressor.h
nxcomp/Statistics.cpp
nxcomp/Statistics.cpp
nxcomp/Statistics.h
nxcomp/Statistics.h
nxcomp/TextCompressor.cpp
nxcomp/TextCompressor.h
nxcomp/Timestamp.cpp
nxcomp/Timestamp.cpp
nxcomp/Timestamp.h
nxcomp/Timestamp.h
nxcomp/TranslateCoords.cpp
nxcomp/TranslateCoords.cpp
...
...
doc/nxcomp/nxcomp-3.6-drops-compat-code-3.4.x-testing.pdf
0 → 100644
View file @
03b65211
File added
nxcomp/ActionCacheCompat.h
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef ActionCacheCompat_H
#define ActionCacheCompat_H
#include "CharCache.h"
class
ActionCacheCompat
{
friend
class
EncodeBuffer
;
friend
class
DecodeBuffer
;
public
:
ActionCacheCompat
()
{
slot_
=
0
;
}
~
ActionCacheCompat
()
{
}
private
:
CharCache
base_
[
4
];
unsigned
char
slot_
;
};
#endif
/* ActionCacheCompat_H */
nxcomp/ChangeGCCompat.cpp
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#include "ChangeGCCompat.h"
#include "ClientCache.h"
#include "EncodeBuffer.h"
#include "DecodeBuffer.h"
//
// Set the verbosity level.
//
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
#undef DUMP
//
// Here are the methods to handle messages' content.
//
int
ChangeGCCompatStore
::
parseIdentity
(
Message
*
message
,
const
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
{
ChangeGCCompatMessage
*
changeGC
=
(
ChangeGCCompatMessage
*
)
message
;
//
// Here is the fingerprint.
//
changeGC
->
gcontext
=
GetULONG
(
buffer
+
4
,
bigEndian
);
changeGC
->
value_mask
=
GetULONG
(
buffer
+
8
,
bigEndian
);
//
// Clear the unused bytes carried in the
// payload to increase the effectiveness
// of the caching algorithm.
//
if
((
int
)
size
>
dataOffset
)
{
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Removing unused bytes from the "
<<
"data payload.
\n
"
<<
logofs_flush
;
#endif
changeGC
->
value_mask
&=
(
1
<<
23
)
-
1
;
unsigned
int
mask
=
0x1
;
unsigned
char
*
source
=
(
unsigned
char
*
)
buffer
+
CHANGEGC_DATA_OFFSET
;
unsigned
long
value
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
23
;
i
++
)
{
if
(
changeGC
->
value_mask
&
mask
)
{
value
=
GetULONG
(
source
,
bigEndian
);
value
&=
(
0xffffffff
>>
(
32
-
CREATEGC_FIELD_WIDTH
[
i
]));
PutULONG
(
value
,
source
,
bigEndian
);
source
+=
4
;
}
mask
<<=
1
;
}
}
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Parsed Identity for message at "
<<
this
<<
".
\n
"
<<
logofs_flush
;
#endif
return
1
;
}
int
ChangeGCCompatStore
::
unparseIdentity
(
const
Message
*
message
,
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
{
ChangeGCCompatMessage
*
changeGC
=
(
ChangeGCCompatMessage
*
)
message
;
//
// Fill all the message's fields.
//
PutULONG
(
changeGC
->
gcontext
,
buffer
+
4
,
bigEndian
);
PutULONG
(
changeGC
->
value_mask
,
buffer
+
8
,
bigEndian
);
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Unparsed identity for message at "
<<
this
<<
".
\n
"
<<
logofs_flush
;
#endif
return
1
;
}
void
ChangeGCCompatStore
::
dumpIdentity
(
const
Message
*
message
)
const
{
#ifdef DUMP
ChangeGCCompatMessage
*
changeGC
=
(
ChangeGCCompatMessage
*
)
message
;
*
logofs
<<
name
()
<<
": Identity gcontext "
<<
changeGC
->
gcontext
<<
", mask "
<<
changeGC
->
value_mask
<<
", size "
<<
changeGC
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
void
ChangeGCCompatStore
::
identityChecksum
(
const
Message
*
message
,
const
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
{
md5_append
(
md5_state_
,
buffer
+
4
,
8
);
}
nxcomp/ChangeGCCompat.h
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef ChangeGCCompat_H
#define ChangeGCCompat_H
#include "Message.h"
//
// Set the verbosity level.
//
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
#undef DUMP
//
// Set default values.
//
#define CHANGEGC_ENABLE_CACHE 1
#define CHANGEGC_ENABLE_DATA 0
#define CHANGEGC_ENABLE_SPLIT 0
#define CHANGEGC_ENABLE_COMPRESS 0
#define CHANGEGC_DATA_LIMIT 144
#define CHANGEGC_DATA_OFFSET 12
#define CHANGEGC_CACHE_SLOTS 3000
#define CHANGEGC_CACHE_THRESHOLD 3
#define CHANGEGC_CACHE_LOWER_THRESHOLD 1
//
// The message class.
//
class
ChangeGCCompatMessage
:
public
Message
{
friend
class
ChangeGCCompatStore
;
public
:
ChangeGCCompatMessage
()
{
}
~
ChangeGCCompatMessage
()
{
}
//
// Put here the fields which constitute
// the 'identity' part of the message.
//
private
:
unsigned
int
gcontext
;
unsigned
int
value_mask
;
};
class
ChangeGCCompatStore
:
public
MessageStore
{
//
// Constructors and destructors.
//
public
:
ChangeGCCompatStore
()
:
MessageStore
()
{
enableCache
=
CHANGEGC_ENABLE_CACHE
;
enableData
=
CHANGEGC_ENABLE_DATA
;
enableSplit
=
CHANGEGC_ENABLE_SPLIT
;
enableCompress
=
CHANGEGC_ENABLE_COMPRESS
;
dataLimit
=
CHANGEGC_DATA_LIMIT
;
dataOffset
=
CHANGEGC_DATA_OFFSET
;
cacheSlots
=
CHANGEGC_CACHE_SLOTS
;
cacheThreshold
=
CHANGEGC_CACHE_THRESHOLD
;
cacheLowerThreshold
=
CHANGEGC_CACHE_LOWER_THRESHOLD
;
messages_
->
resize
(
cacheSlots
);
for
(
T_messages
::
iterator
i
=
messages_
->
begin
();
i
<
messages_
->
end
();
i
++
)
{
*
i
=
NULL
;
}
temporary_
=
NULL
;
}
virtual
~
ChangeGCCompatStore
()
{
for
(
T_messages
::
iterator
i
=
messages_
->
begin
();
i
<
messages_
->
end
();
i
++
)
{
destroy
(
*
i
);
}
destroy
(
temporary_
);
}
virtual
const
char
*
name
()
const
{
return
"ChangeGCCompat"
;
}
virtual
unsigned
char
opcode
()
const
{
return
X_ChangeGC
;
}
virtual
unsigned
int
storage
()
const
{
return
sizeof
(
ChangeGCCompatMessage
);
}
//
// Message handling methods.
//
public
:
virtual
Message
*
create
()
const
{
return
new
ChangeGCCompatMessage
();
}
virtual
Message
*
create
(
const
Message
&
message
)
const
{
return
new
ChangeGCCompatMessage
((
const
ChangeGCCompatMessage
&
)
message
);
}
virtual
void
destroy
(
Message
*
message
)
const
{
delete
(
ChangeGCCompatMessage
*
)
message
;
}
virtual
int
parseIdentity
(
Message
*
message
,
const
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
;
virtual
int
unparseIdentity
(
const
Message
*
message
,
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
;
virtual
void
identityChecksum
(
const
Message
*
message
,
const
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
;
virtual
void
dumpIdentity
(
const
Message
*
message
)
const
;
};
#endif
/* ChangeGCCompat_H */
nxcomp/Channel.cpp
View file @
03b65211
...
@@ -386,16 +386,14 @@ int Channel::handleDecode(DecodeBuffer &decodeBuffer, ChannelCache *channelCache
...
@@ -386,16 +386,14 @@ 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
"
<<
logofs_flush
;
<<
logofs_flush
;
#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,20 +803,9 @@ int Channel::handleEncodeCached(EncodeBuffer &encodeBuffer, ChannelCache *channe
...
@@ -843,20 +803,9 @@ 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
;
}
}
...
@@ -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,16 +971,9 @@ int Channel::handleDecodeCached(DecodeBuffer &decodeBuffer, ChannelCache *channe
...
@@ -1046,16 +971,9 @@ 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
);
}
}
}
//
//
...
@@ -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 "
...
...
nxcomp/ChannelCache.h
View file @
03b65211
...
@@ -19,13 +19,6 @@
...
@@ -19,13 +19,6 @@
#define ChannelCache_H
#define ChannelCache_H
//
//
// Elements in array of caches used in TextCompressor.
//
const
unsigned
int
CLIENT_TEXT_CACHE_SIZE
=
9999
;
const
unsigned
int
SERVER_TEXT_CACHE_SIZE
=
9999
;
//
// Sizes of optional fields for ConfigureWindow
// Sizes of optional fields for ConfigureWindow
// request.
// request.
//
//
...
...
nxcomp/ClientCache.cpp
View file @
03b65211
...
@@ -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
),
...
@@ -107,8 +100,6 @@ ClientCache::ClientCache() :
...
@@ -107,8 +100,6 @@ ClientCache::ClientCache() :
renderLastId
(
0
),
renderLastId
(
0
),
renderTextCompressor
(
textCache
,
CLIENT_TEXT_CACHE_SIZE
),
renderGlyphXCache
(
16
),
renderGlyphYCache
(
16
),
renderGlyphXCache
(
16
),
renderGlyphYCache
(
16
),
renderGlyphX
(
0
),
renderGlyphY
(
0
),
renderGlyphX
(
0
),
renderGlyphY
(
0
),
...
...
nxcomp/ClientCache.h
View file @
03b65211
...
@@ -26,8 +26,6 @@
...
@@ -26,8 +26,6 @@
#include "XidCache.h"
#include "XidCache.h"
#include "FreeCache.h"
#include "FreeCache.h"
#include "TextCompressor.h"
#include "ChannelCache.h"
#include "ChannelCache.h"
class
ClientCache
:
public
ChannelCache
class
ClientCache
:
public
ChannelCache
...
@@ -61,7 +59,6 @@ class ClientCache : public ChannelCache
...
@@ -61,7 +59,6 @@ class ClientCache : public ChannelCache
// General-purpose caches.
// General-purpose caches.
//
//
CharCache
textCache
[
CLIENT_TEXT_CACHE_SIZE
];
IntCache
cursorCache
;
IntCache
cursorCache
;
IntCache
colormapCache
;
IntCache
colormapCache
;
IntCache
visualCache
;
IntCache
visualCache
;
...
@@ -85,7 +82,6 @@ class ClientCache : public ChannelCache
...
@@ -85,7 +82,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 +184,6 @@ class ClientCache : public ChannelCache
...
@@ -188,19 +184,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 +234,6 @@ class ClientCache : public ChannelCache
...
@@ -251,7 +234,6 @@ class ClientCache : public ChannelCache
IntCache
polyTextCacheY
;
IntCache
polyTextCacheY
;
IntCache
polyTextFontCache
;
IntCache
polyTextFontCache
;
CharCache
polyTextDeltaCache
;
CharCache
polyTextDeltaCache
;
TextCompressor
polyTextTextCompressor
;
//
//
// PutImage request.
// PutImage request.
...
@@ -398,8 +380,6 @@ class ClientCache : public ChannelCache
...
@@ -398,8 +380,6 @@ class ClientCache : public ChannelCache
IntCache
*
renderDataCache
[
16
];
IntCache
*
renderDataCache
[
16
];
TextCompressor
renderTextCompressor
;
IntCache
renderGlyphXCache
;
IntCache
renderGlyphXCache
;
IntCache
renderGlyphYCache
;
IntCache
renderGlyphYCache
;
...
...
nxcomp/ClientChannel.cpp
View file @
03b65211
...
@@ -155,13 +155,6 @@ ClientChannel::ClientChannel(Transport *transport, StaticCompressor *compressor)
...
@@ -155,13 +155,6 @@ ClientChannel::ClientChannel(Transport *transport, StaticCompressor *compressor)
splitState_
.
mode
=
split_none
;
splitState_
.
mode
=
split_none
;
//
//
// Disable image streaming if the remote
// doesn't support our proxy version.
//
handleSplitEnable
();
//
// Number of outstanding tainted replies.
// Number of outstanding tainted replies.
//
//
...
@@ -342,10 +335,8 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
...
@@ -342,10 +335,8 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
// previous versions.
// previous versions.
//
//
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
encodeBuffer
.
encodeValue
(
inputLength
,
8
);
encodeBuffer
.
encodeValue
(
inputLength
,
8
);
}
for
(
unsigned
int
i
=
0
;
i
<
inputLength
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
inputLength
;
i
++
)
{
{
...
@@ -364,20 +355,6 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
...
@@ -364,20 +355,6 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
#endif
#endif
priority_
++
;
priority_
++
;
//
// Due to the way the loop was implemented
// we can't encode multiple messages if we
// are encoding the first request.
//
if
(
control
->
isProtoStep7
()
==
0
)
{
if
(
proxy
->
handleAsyncInit
()
<
0
)
{
return
-
1
;
}
}
}
}
else
else
{
{
...
@@ -512,17 +489,8 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
...
@@ -512,17 +489,8 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
const
unsigned
char
*
nextSrc
=
inputMessage
+
24
;
const
unsigned
char
*
nextSrc
=
inputMessage
+
24
;
if
(
format
==
8
)
if
(
format
==
8
)
{
{
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
encodeBuffer
.
encodeTextData
(
nextSrc
,
dataLength
);
encodeBuffer
.
encodeTextData
(
nextSrc
,
dataLength
);
}
else
{
clientCache_
->
changePropertyTextCompressor
.
reset
();
for
(
unsigned
int
i
=
0
;
i
<
dataLength
;
i
++
)
clientCache_
->
changePropertyTextCompressor
.
encodeChar
(
*
nextSrc
++
,
encodeBuffer
);
}
}
}
else
if
(
format
==
32
)
else
if
(
format
==
32
)
{
{
...
@@ -872,18 +840,11 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
...
@@ -872,18 +840,11 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
break
;
break
;
}
}
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
encodeBuffer
.
encodeNewXidValue
(
GetULONG
(
inputMessage
+
4
,
bigEndian_
),
encodeBuffer
.
encodeNewXidValue
(
GetULONG
(
inputMessage
+
4
,
bigEndian_
),
clientCache_
->
lastId
,
clientCache_
->
lastIdCache
,
clientCache_
->
lastId
,
clientCache_
->
lastIdCache
,
clientCache_
->
gcCache
,
clientCache_
->
gcCache
,
clientCache_
->
freeGCCache
);
clientCache_
->
freeGCCache
);
}
else
{
encodeBuffer
.
encodeXidValue
(
GetULONG
(
inputMessage
+
4
,
bigEndian_
),
clientCache_
->
gcCache
);
}
const
unsigned
char
*
nextSrc
=
inputMessage
+
8
;
const
unsigned
char
*
nextSrc
=
inputMessage
+
8
;
encodeBuffer
.
encodeXidValue
(
GetULONG
(
inputMessage
+
8
,
encodeBuffer
.
encodeXidValue
(
GetULONG
(
inputMessage
+
8
,
...
@@ -1059,18 +1020,12 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
...
@@ -1059,18 +1020,12 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
encodeBuffer
.
encodeXidValue
(
GetULONG
(
inputMessage
+
8
,
bigEndian_
),
encodeBuffer
.
encodeXidValue
(
GetULONG
(
inputMessage
+
8
,
bigEndian_
),
clientCache_
->
windowCache
);
clientCache_
->
windowCache
);
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
encodeBuffer
.
encodeNewXidValue
(
GetULONG
(
inputMessage
+
4
,
bigEndian_
),
encodeBuffer
.
encodeNewXidValue
(
GetULONG
(
inputMessage
+
4
,
bigEndian_
),
clientCache_
->
lastId
,
clientCache_
->
lastIdCache
,
clientCache_
->
lastId
,
clientCache_
->
lastIdCache
,
clientCache_
->
windowCache
,
clientCache_
->
windowCache
,
clientCache_
->
freeWindowCache
);
clientCache_
->
freeWindowCache
);
}
else
{
encodeBuffer
.
encodeXidValue
(
GetULONG
(
inputMessage
+
4
,
bigEndian_
),
clientCache_
->
windowCache
);
}
const
unsigned
char
*
nextSrc
=
inputMessage
+
12
;
const
unsigned
char
*
nextSrc
=
inputMessage
+
12
;
for
(
unsigned
int
i
=
0
;
i
<
6
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
6
;
i
++
)
{
{
...
@@ -1140,16 +1095,9 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
...
@@ -1140,16 +1095,9 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
unsigned
int
numPoints
=
((
inputLength
-
16
)
>>
2
);
unsigned
int
numPoints
=
((
inputLength
-
16
)
>>
2
);
if
(
control
->
isProtoStep10
()
==
1
)
// Since ProtoStep10 (#issue 108)
{
encodeBuffer
.
encodeCachedValue
(
numPoints
,
16
,
encodeBuffer
.
encodeCachedValue
(
numPoints
,
16
,
clientCache_
->
fillPolyNumPointsCache
,
4
);
clientCache_
->
fillPolyNumPointsCache
,
4
);
}
else
{
encodeBuffer
.
encodeCachedValue
(
numPoints
,
14
,
clientCache_
->
fillPolyNumPointsCache
,
4
);
}
encodeBuffer
.
encodeXidValue
(
GetULONG
(
inputMessage
+
4
,
bigEndian_
),
encodeBuffer
.
encodeXidValue
(
GetULONG
(
inputMessage
+
4
,
bigEndian_
),
clientCache_
->
drawableCache
);
clientCache_
->
drawableCache
);
...
@@ -1270,16 +1218,9 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
...
@@ -1270,16 +1218,9 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
#endif
#endif
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
encodeBuffer
.
encodeFreeXidValue
(
GetULONG
(
inputMessage
+
4
,
bigEndian_
),
encodeBuffer
.
encodeFreeXidValue
(
GetULONG
(
inputMessage
+
4
,
bigEndian_
),
clientCache_
->
freeGCCache
);
clientCache_
->
freeGCCache
);
}
else
{
encodeBuffer
.
encodeXidValue
(
GetULONG
(
inputMessage
+
4
,
bigEndian_
),
clientCache_
->
gcCache
);
}
}
}
break
;
break
;
case
X_FreePixmap
:
case
X_FreePixmap
:
...
@@ -1294,26 +1235,9 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
...
@@ -1294,26 +1235,9 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
#endif
#endif
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
encodeBuffer
.
encodeFreeXidValue
(
GetULONG
(
inputMessage
+
4
,
bigEndian_
),
encodeBuffer
.
encodeFreeXidValue
(
GetULONG
(
inputMessage
+
4
,
bigEndian_
),
clientCache_
->
freeDrawableCache
);
clientCache_
->
freeDrawableCache
);
}
else
{
unsigned
int
pixmap
=
GetULONG
(
inputMessage
+
4
,
bigEndian_
);
unsigned
int
diff
=
pixmap
-
clientCache_
->
createPixmapLastId
;
if
(
diff
==
0
)
{
encodeBuffer
.
encodeBoolValue
(
1
);
}
else
{
encodeBuffer
.
encodeBoolValue
(
0
);
clientCache_
->
createPixmapLastId
=
pixmap
;
encodeBuffer
.
encodeValue
(
diff
,
29
,
4
);
}
}
}
}
break
;
break
;
case
X_GetAtomName
:
case
X_GetAtomName
:
...
@@ -1536,18 +1460,9 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
...
@@ -1536,18 +1460,9 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
encodeBuffer
.
encodeCachedValue
(
*
nextSrc
++
,
8
,
encodeBuffer
.
encodeCachedValue
(
*
nextSrc
++
,
8
,
clientCache_
->
polyTextDeltaCache
);
clientCache_
->
polyTextDeltaCache
);
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
encodeBuffer
.
encodeTextData
(
nextSrc
,
textLength
);
encodeBuffer
.
encodeTextData
(
nextSrc
,
textLength
);
nextSrc
+=
textLength
;
nextSrc
+=
textLength
;
}
else
{
clientCache_
->
polyTextTextCompressor
.
reset
();
for
(
unsigned
int
i
=
0
;
i
<
textLength
;
i
++
)
clientCache_
->
polyTextTextCompressor
.
encodeChar
(
*
nextSrc
++
,
encodeBuffer
);
}
}
}
}
}
encodeBuffer
.
encodeBoolValue
(
0
);
encodeBuffer
.
encodeBoolValue
(
0
);
...
@@ -1620,18 +1535,9 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
...
@@ -1620,18 +1535,9 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
encodeBuffer
.
encodeCachedValue
(
*
nextSrc
++
,
8
,
encodeBuffer
.
encodeCachedValue
(
*
nextSrc
++
,
8
,
clientCache_
->
polyTextDeltaCache
);
clientCache_
->
polyTextDeltaCache
);
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
encodeBuffer
.
encodeTextData
(
nextSrc
,
textLength
*
2
);
encodeBuffer
.
encodeTextData
(
nextSrc
,
textLength
*
2
);
nextSrc
+=
textLength
*
2
;
nextSrc
+=
textLength
*
2
;
}
else
{
clientCache_
->
polyTextTextCompressor
.
reset
();
for
(
unsigned
int
i
=
0
;
i
<
textLength
*
2
;
i
++
)
clientCache_
->
polyTextTextCompressor
.
encodeChar
(
*
nextSrc
++
,
encodeBuffer
);
}
}
}
}
}
encodeBuffer
.
encodeBoolValue
(
0
);
encodeBuffer
.
encodeBoolValue
(
0
);
...
@@ -1692,16 +1598,8 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
...
@@ -1692,16 +1598,8 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
clientCache_
->
imageTextCacheY
);
clientCache_
->
imageTextCacheY
);
const
unsigned
char
*
nextSrc
=
inputMessage
+
16
;
const
unsigned
char
*
nextSrc
=
inputMessage
+
16
;
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
encodeBuffer
.
encodeTextData
(
nextSrc
,
textLength
);
encodeBuffer
.
encodeTextData
(
nextSrc
,
textLength
);
}
else
{
clientCache_
->
imageTextTextCompressor
.
reset
();
for
(
unsigned
int
j
=
0
;
j
<
textLength
;
j
++
)
clientCache_
->
imageTextTextCompressor
.
encodeChar
(
*
nextSrc
++
,
encodeBuffer
);
}
}
}
break
;
break
;
case
X_ImageText16
:
case
X_ImageText16
:
...
@@ -1759,16 +1657,8 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
...
@@ -1759,16 +1657,8 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
clientCache_
->
imageTextCacheY
);
clientCache_
->
imageTextCacheY
);
const
unsigned
char
*
nextSrc
=
inputMessage
+
16
;
const
unsigned
char
*
nextSrc
=
inputMessage
+
16
;
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
encodeBuffer
.
encodeTextData
(
nextSrc
,
textLength
*
2
);
encodeBuffer
.
encodeTextData
(
nextSrc
,
textLength
*
2
);
}
else
{
clientCache_
->
imageTextTextCompressor
.
reset
();
for
(
unsigned
int
j
=
0
;
j
<
textLength
*
2
;
j
++
)
clientCache_
->
imageTextTextCompressor
.
encodeChar
(
*
nextSrc
++
,
encodeBuffer
);
}
}
}
break
;
break
;
case
X_InternAtom
:
case
X_InternAtom
:
...
@@ -1800,18 +1690,8 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
...
@@ -1800,18 +1690,8 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
encodeBuffer
.
encodeBoolValue
((
unsigned
int
)
inputMessage
[
1
]);
encodeBuffer
.
encodeBoolValue
((
unsigned
int
)
inputMessage
[
1
]);
const
unsigned
char
*
nextSrc
=
inputMessage
+
8
;
const
unsigned
char
*
nextSrc
=
inputMessage
+
8
;
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
encodeBuffer
.
encodeTextData
(
nextSrc
,
nameLength
);
encodeBuffer
.
encodeTextData
(
nextSrc
,
nameLength
);
}
else
{
clientCache_
->
internAtomTextCompressor
.
reset
();
for
(
unsigned
int
i
=
0
;
i
<
nameLength
;
i
++
)
{
clientCache_
->
internAtomTextCompressor
.
encodeChar
(
*
nextSrc
++
,
encodeBuffer
);
}
}
sequenceQueue_
.
push
(
clientSequence_
,
inputOpcode
);
sequenceQueue_
.
push
(
clientSequence_
,
inputOpcode
);
...
@@ -1832,18 +1712,8 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
...
@@ -1832,18 +1712,8 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
encodeBuffer
.
encodeValue
(
GetUINT
(
inputMessage
+
4
,
bigEndian_
),
16
,
6
);
encodeBuffer
.
encodeValue
(
GetUINT
(
inputMessage
+
4
,
bigEndian_
),
16
,
6
);
const
unsigned
char
*
nextSrc
=
inputMessage
+
8
;
const
unsigned
char
*
nextSrc
=
inputMessage
+
8
;
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
encodeBuffer
.
encodeTextData
(
nextSrc
,
textLength
);
encodeBuffer
.
encodeTextData
(
nextSrc
,
textLength
);
}
else
{
clientCache_
->
polyTextTextCompressor
.
reset
();
for
(
unsigned
int
i
=
0
;
i
<
textLength
;
i
++
)
{
clientCache_
->
polyTextTextCompressor
.
encodeChar
(
*
nextSrc
++
,
encodeBuffer
);
}
}
sequenceQueue_
.
push
(
clientSequence_
,
inputOpcode
);
sequenceQueue_
.
push
(
clientSequence_
,
inputOpcode
);
...
@@ -1859,18 +1729,8 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
...
@@ -1859,18 +1729,8 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
29
,
clientCache_
->
colormapCache
);
29
,
clientCache_
->
colormapCache
);
const
unsigned
char
*
nextSrc
=
inputMessage
+
12
;
const
unsigned
char
*
nextSrc
=
inputMessage
+
12
;
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
encodeBuffer
.
encodeTextData
(
nextSrc
,
textLength
);
encodeBuffer
.
encodeTextData
(
nextSrc
,
textLength
);
}
else
{
clientCache_
->
polyTextTextCompressor
.
reset
();
for
(
unsigned
int
i
=
0
;
i
<
textLength
;
i
++
)
{
clientCache_
->
polyTextTextCompressor
.
encodeChar
(
*
nextSrc
++
,
encodeBuffer
);
}
}
sequenceQueue_
.
push
(
clientSequence_
,
inputOpcode
);
sequenceQueue_
.
push
(
clientSequence_
,
inputOpcode
);
...
@@ -1900,8 +1760,9 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
...
@@ -1900,8 +1760,9 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
#endif
#endif
if
(
inputOpcode
==
X_DestroyWindow
&&
control
->
isProtoStep7
()
==
1
)
if
(
inputOpcode
==
X_DestroyWindow
)
{
{
// Since ProtoStep7 (#issue 108)
encodeBuffer
.
encodeFreeXidValue
(
GetULONG
(
inputMessage
+
4
,
bigEndian_
),
encodeBuffer
.
encodeFreeXidValue
(
GetULONG
(
inputMessage
+
4
,
bigEndian_
),
clientCache_
->
freeWindowCache
);
clientCache_
->
freeWindowCache
);
}
}
...
@@ -1930,19 +1791,8 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
...
@@ -1930,19 +1791,8 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
clientCache_
->
lastFont
=
font
;
clientCache_
->
lastFont
=
font
;
const
unsigned
char
*
nextSrc
=
inputMessage
+
12
;
const
unsigned
char
*
nextSrc
=
inputMessage
+
12
;
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
encodeBuffer
.
encodeTextData
(
nextSrc
,
nameLength
);
encodeBuffer
.
encodeTextData
(
nextSrc
,
nameLength
);
}
else
{
clientCache_
->
openFontTextCompressor
.
reset
();
for
(;
nameLength
;
nameLength
--
)
{
clientCache_
->
openFontTextCompressor
.
encodeChar
(
*
nextSrc
++
,
encodeBuffer
);
}
}
}
}
break
;
break
;
case
X_PolyFillRectangle
:
case
X_PolyFillRectangle
:
...
@@ -2638,14 +2488,8 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
...
@@ -2638,14 +2488,8 @@ int ClientChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
unsigned
int
numRectangles
=
((
inputLength
-
12
)
>>
3
);
unsigned
int
numRectangles
=
((
inputLength
-
12
)
>>
3
);
if
(
control
->
isProtoStep9
()
==
1
)
// Since ProtoStep9 (#issue 108)
{
encodeBuffer
.
encodeValue
(
numRectangles
,
15
,
4
);
encodeBuffer
.
encodeValue
(
numRectangles
,
15
,
4
);
}
else
{
encodeBuffer
.
encodeValue
(
numRectangles
,
13
,
4
);
}
encodeBuffer
.
encodeValue
((
unsigned
int
)
inputMessage
[
1
],
2
);
encodeBuffer
.
encodeValue
((
unsigned
int
)
inputMessage
[
1
],
2
);
encodeBuffer
.
encodeXidValue
(
GetULONG
(
inputMessage
+
4
,
bigEndian_
),
encodeBuffer
.
encodeXidValue
(
GetULONG
(
inputMessage
+
4
,
bigEndian_
),
...
@@ -3544,19 +3388,8 @@ int ClientChannel::handleWrite(const unsigned char *message, unsigned int length
...
@@ -3544,19 +3388,8 @@ int ClientChannel::handleWrite(const unsigned char *message, unsigned int length
PutUINT
(
nameLength
,
outputMessage
+
8
,
bigEndian_
);
PutUINT
(
nameLength
,
outputMessage
+
8
,
bigEndian_
);
unsigned
char
*
nextDest
=
outputMessage
+
32
;
unsigned
char
*
nextDest
=
outputMessage
+
32
;
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
decodeBuffer
.
decodeTextData
(
nextDest
,
nameLength
);
decodeBuffer
.
decodeTextData
(
nextDest
,
nameLength
);
}
else
{
serverCache_
->
getAtomNameTextCompressor
.
reset
();
for
(
unsigned
int
i
=
0
;
i
<
nameLength
;
i
++
)
{
*
nextDest
++
=
serverCache_
->
getAtomNameTextCompressor
.
decodeChar
(
decodeBuffer
);
}
}
}
}
break
;
break
;
case
X_GetGeometry
:
case
X_GetGeometry
:
...
@@ -3814,21 +3647,9 @@ int ClientChannel::handleWrite(const unsigned char *message, unsigned int length
...
@@ -3814,21 +3647,9 @@ int ClientChannel::handleWrite(const unsigned char *message, unsigned int length
decodeBuffer
.
decodeValue
(
length
,
8
);
decodeBuffer
.
decodeValue
(
length
,
8
);
*
nextDest
++
=
(
unsigned
char
)
length
;
*
nextDest
++
=
(
unsigned
char
)
length
;
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
decodeBuffer
.
decodeTextData
(
nextDest
,
length
);
decodeBuffer
.
decodeTextData
(
nextDest
,
length
);
nextDest
+=
length
;
nextDest
+=
length
;
}
else
{
serverCache_
->
getPropertyTextCompressor
.
reset
();
for
(;
length
;
length
--
)
{
*
nextDest
++
=
serverCache_
->
getPropertyTextCompressor
.
decodeChar
(
decodeBuffer
);
}
}
}
}
handleSave
(
messageStore
,
outputMessage
,
outputLength
);
handleSave
(
messageStore
,
outputMessage
,
outputLength
);
...
@@ -4243,35 +4064,11 @@ int ClientChannel::handleWrite(const unsigned char *message, unsigned int length
...
@@ -4243,35 +4064,11 @@ int ClientChannel::handleWrite(const unsigned char *message, unsigned int length
serverCache_
->
visualCache
);
serverCache_
->
visualCache
);
PutULONG
(
visual
,
outputMessage
+
8
,
bigEndian_
);
PutULONG
(
visual
,
outputMessage
+
8
,
bigEndian_
);
if
(
control
->
isProtoStep8
()
==
0
)
// Since ProtoStep8 (#issue 108)
{
handleCopy
(
decodeBuffer
,
requestOpcode
,
messageStore
->
const
unsigned
char
*
compressedData
=
NULL
;
dataOffset
,
outputMessage
,
outputLength
);
unsigned
int
compressedDataSize
=
0
;
int
decompressed
=
handleDecompress
(
decodeBuffer
,
requestOpcode
,
messageStore
->
dataOffset
,
handleSave
(
messageStore
,
outputMessage
,
outputLength
);
outputMessage
,
outputLength
,
compressedData
,
compressedDataSize
);
if
(
decompressed
<
0
)
{
return
-
1
;
}
else
if
(
decompressed
>
0
)
{
handleSave
(
messageStore
,
outputMessage
,
outputLength
,
compressedData
,
compressedDataSize
);
}
else
{
handleSave
(
messageStore
,
outputMessage
,
outputLength
);
}
}
else
{
handleCopy
(
decodeBuffer
,
requestOpcode
,
messageStore
->
dataOffset
,
outputMessage
,
outputLength
);
handleSave
(
messageStore
,
outputMessage
,
outputLength
);
}
}
}
break
;
break
;
case
X_GetPointerMapping
:
case
X_GetPointerMapping
:
...
@@ -5090,40 +4887,23 @@ int ClientChannel::handleSplit(EncodeBuffer &encodeBuffer, MessageStore *store,
...
@@ -5090,40 +4887,23 @@ int ClientChannel::handleSplit(EncodeBuffer &encodeBuffer, MessageStore *store,
{
{
#if defined(TEST) || defined(SPLIT)
#if defined(TEST) || defined(SPLIT)
if
(
control
->
isProtoStep8
()
==
1
)
// Since ProtoStep8 (#issue 108)
{
*
logofs
<<
"handleSplit: PANIC! SPLIT! Split should "
*
logofs
<<
"handleSplit: PANIC! SPLIT! Split should "
<<
"not be enabled for message "
<<
"OPCODE#"
<<
"not be enabled for message "
<<
"OPCODE#"
<<
(
unsigned
int
)
store
->
opcode
()
<<
".
\n
"
<<
(
unsigned
int
)
store
->
opcode
()
<<
".
\n
"
<<
logofs_flush
;
<<
logofs_flush
;
HandleCleanup
();
HandleCleanup
();
}
#endif
#endif
//
//
// Never split the message if connected to
// Refuse the split if it is not introduced
// an old proxy version. Also refuse the
// by a start split.
// split if we it is not introduced by a
// start split.
//
//
if
(
control
->
isProtoStep7
()
==
0
)
// Since ProtoStep7 (#issue 108)
{
if
(
splitState_
.
resource
==
nothing
||
enableSplit_
==
0
)
#if defined(TEST) || defined(SPLIT)
*
logofs
<<
"handleSplit: SPLIT! Ignoring the split with "
<<
"an old proxy version.
\n
"
<<
logofs_flush
;
#endif
if
(
action
==
IS_ADDED
||
action
==
is_discarded
)
{
encodeBuffer
.
encodeBoolValue
(
0
);
}
return
0
;
}
else
if
(
splitState_
.
resource
==
nothing
||
enableSplit_
==
0
)
{
{
#if defined(TEST) || defined(SPLIT)
#if defined(TEST) || defined(SPLIT)
*
logofs
<<
"handleSplit: SPLIT! Nothing to do for message "
*
logofs
<<
"handleSplit: SPLIT! Nothing to do for message "
...
@@ -5875,16 +5655,7 @@ int ClientChannel::handleSplitEvent(DecodeBuffer &decodeBuffer)
...
@@ -5875,16 +5655,7 @@ int ClientChannel::handleSplitEvent(DecodeBuffer &decodeBuffer)
<<
strMsTimestamp
()
<<
".
\n
"
<<
logofs_flush
;
<<
strMsTimestamp
()
<<
".
\n
"
<<
logofs_flush
;
#endif
#endif
if
(
control
->
isProtoStep7
()
==
0
)
// Since ProtoStep7 (#issue 108)
{
#ifdef PANIC
*
logofs
<<
"handleSplitEvent: PANIC! The split can't "
<<
"be aborted when connected to an old "
<<
"proxy version.
\n
"
<<
logofs_flush
;
#endif
HandleCleanup
();
}
//
//
// Decode the information about the
// Decode the information about the
...
@@ -6512,146 +6283,6 @@ int ClientChannel::handleRestart(T_sequence_mode mode, int resource)
...
@@ -6512,146 +6283,6 @@ int ClientChannel::handleRestart(T_sequence_mode mode, int resource)
return
1
;
return
1
;
}
}
int
ClientChannel
::
handleTaintCacheRequest
(
unsigned
char
&
opcode
,
const
unsigned
char
*&
buffer
,
unsigned
int
&
size
)
{
#ifdef TEST
*
logofs
<<
"handleTaintCacheRequest: Tainting cache request "
<<
"for FD#"
<<
fd_
<<
".
\n
"
<<
logofs_flush
;
#endif
//
// The save and load flags would affect
// the decoding side but the decoding
// side doesn't support the request.
//
enableCache_
=
*
(
buffer
+
4
);
enableSplit_
=
*
(
buffer
+
5
);
handleSplitEnable
();
#ifdef TEST
*
logofs
<<
"handleTaintCacheRequest: Set cache parameters to "
<<
"cache "
<<
enableCache_
<<
" split "
<<
enableSplit_
<<
" load "
<<
enableLoad_
<<
" save "
<<
enableSave_
<<
".
\n
"
<<
logofs_flush
;
#endif
//
// Taint the request to a X_NoOperation.
//
opcode
=
X_NoOperation
;
return
0
;
}
int
ClientChannel
::
handleTaintFontRequest
(
unsigned
char
&
opcode
,
const
unsigned
char
*&
buffer
,
unsigned
int
&
size
)
{
//
// The remote end doesn't support this
// request so generate an empty reply
// at the local side.
//
#ifdef TEST
*
logofs
<<
"handleTaintFontRequest: Suppressing font "
<<
"request for FD#"
<<
fd_
<<
".
\n
"
<<
logofs_flush
;
#endif
//
// The client sequence number has not
// been incremented yet in the loop.
//
unsigned
int
sequence
=
(
clientSequence_
+
1
)
&
0xffff
;
#ifdef TEST
*
logofs
<<
"handleTaintFontRequest: Opcode is "
<<
(
unsigned
)
opcode
<<
" expected client sequence is "
<<
sequence
<<
".
\n
"
<<
logofs_flush
;
#endif
unsigned
char
*
reply
=
writeBuffer_
.
addMessage
(
36
);
*
(
reply
+
0
)
=
X_Reply
;
PutUINT
(
sequence
,
reply
+
2
,
bigEndian_
);
PutULONG
(
1
,
reply
+
4
,
bigEndian_
);
//
// Set the length of the returned
// path to 0.
//
*
(
reply
+
32
)
=
0
;
//
// Save the sequence number, not incremented
// yet, we used to auto-generate this reply.
//
lastSequence_
=
clientSequence_
+
1
;
#ifdef TEST
*
logofs
<<
"handleTaintFontRequest: Registered "
<<
lastSequence_
<<
" as last auto-generated sequence number.
\n
"
<<
logofs_flush
;
#endif
//
// Taint the request to a X_NoOperation.
//
opcode
=
X_NoOperation
;
if
(
handleFlush
(
flush_if_any
)
<
0
)
{
return
-
1
;
}
return
1
;
}
int
ClientChannel
::
handleTaintSplitRequest
(
unsigned
char
&
opcode
,
const
unsigned
char
*&
buffer
,
unsigned
int
&
size
)
{
#ifdef TEST
if
(
opcode
==
opcodeStore_
->
abortSplit
)
{
*
logofs
<<
"handleTaintSplitRequest: Tainting abort split "
<<
"request for FD#"
<<
fd_
<<
".
\n
"
<<
logofs_flush
;
}
else
if
(
opcode
==
opcodeStore_
->
finishSplit
)
{
*
logofs
<<
"handleTaintSplitRequest: Tainting finish split "
<<
"request for FD#"
<<
fd_
<<
".
\n
"
<<
logofs_flush
;
}
else
{
*
logofs
<<
"handleTaintSplitRequest: Tainting free split "
<<
"request for FD#"
<<
fd_
<<
".
\n
"
<<
logofs_flush
;
}
#endif
//
// Taint the request to a X_NoOperation.
//
opcode
=
X_NoOperation
;
return
1
;
}
int
ClientChannel
::
handleTaintLameRequest
(
unsigned
char
&
opcode
,
const
unsigned
char
*&
buffer
,
int
ClientChannel
::
handleTaintLameRequest
(
unsigned
char
&
opcode
,
const
unsigned
char
*&
buffer
,
unsigned
int
&
size
)
unsigned
int
&
size
)
{
{
...
@@ -7485,12 +7116,12 @@ int ClientChannel::handleFastReadRequest(EncodeBuffer &encodeBuffer, const unsig
...
@@ -7485,12 +7116,12 @@ int ClientChannel::handleFastReadRequest(EncodeBuffer &encodeBuffer, const unsig
// All the NX requests are handled in the
// All the NX requests are handled in the
// main message loop. The X_PutImage can
// main message loop. The X_PutImage can
// be handled here only if the split was
// be handled here only if the split was
// not requested.
// not requested
(since ProtoStep7 #issue 108)
.
//
//
if
((
opcode
>=
X_NXFirstOpcode
&&
opcode
<=
X_NXLastOpcode
)
||
if
((
opcode
>=
X_NXFirstOpcode
&&
opcode
<=
X_NXLastOpcode
)
||
(
control
->
isProtoStep7
()
==
1
&&
opcode
==
X_PutImage
&&
(
opcode
==
X_PutImage
&&
splitState_
.
resource
!=
nothing
)
||
splitState_
.
resource
!=
nothing
)
||
opcode
==
X_ListExtensions
||
opcode
==
X_ListExtensions
||
opcode
==
X_QueryExtension
)
opcode
==
X_QueryExtension
)
{
{
return
0
;
return
0
;
...
@@ -7977,8 +7608,6 @@ int ClientChannel::handleCacheRequest(EncodeBuffer &encodeBuffer, const unsigned
...
@@ -7977,8 +7608,6 @@ int ClientChannel::handleCacheRequest(EncodeBuffer &encodeBuffer, const unsigned
enableSave_
=
*
(
buffer
+
6
);
enableSave_
=
*
(
buffer
+
6
);
enableLoad_
=
*
(
buffer
+
7
);
enableLoad_
=
*
(
buffer
+
7
);
handleSplitEnable
();
#ifdef TEST
#ifdef TEST
*
logofs
<<
"handleCacheRequest: Set cache parameters to "
*
logofs
<<
"handleCacheRequest: Set cache parameters to "
<<
" cache "
<<
enableCache_
<<
" split "
<<
enableSplit_
<<
" cache "
<<
enableCache_
<<
" split "
<<
enableSplit_
...
@@ -8068,11 +7697,9 @@ int ClientChannel::handleStartSplitRequest(EncodeBuffer &encodeBuffer, const uns
...
@@ -8068,11 +7697,9 @@ int ClientChannel::handleStartSplitRequest(EncodeBuffer &encodeBuffer, const uns
// Send the selected resource to the remote.
// Send the selected resource to the remote.
//
//
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
encodeBuffer
.
encodeCachedValue
(
splitState_
.
resource
,
8
,
encodeBuffer
.
encodeCachedValue
(
splitState_
.
resource
,
8
,
clientCache_
->
resourceCache
);
clientCache_
->
resourceCache
);
}
splitState_
.
mode
=
(
T_split_mode
)
*
(
buffer
+
4
);
splitState_
.
mode
=
(
T_split_mode
)
*
(
buffer
+
4
);
...
@@ -8157,11 +7784,9 @@ int ClientChannel::handleEndSplitRequest(EncodeBuffer &encodeBuffer, const unsig
...
@@ -8157,11 +7784,9 @@ int ClientChannel::handleEndSplitRequest(EncodeBuffer &encodeBuffer, const unsig
// Send the selected resource to the remote.
// Send the selected resource to the remote.
//
//
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
encodeBuffer
.
encodeCachedValue
(
splitState_
.
resource
,
8
,
encodeBuffer
.
encodeCachedValue
(
splitState_
.
resource
,
8
,
clientCache_
->
resourceCache
);
clientCache_
->
resourceCache
);
}
//
//
// Send the split notification events
// Send the split notification events
...
...
nxcomp/ClientChannel.h
View file @
03b65211
...
@@ -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
)
...
...
nxcomp/ClientProxy.h
View file @
03b65211
...
@@ -84,14 +84,8 @@ class ClientProxy : public Proxy
...
@@ -84,14 +84,8 @@ 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
;
}
}
}
//
//
...
...
nxcomp/ClientStore.cpp
View file @
03b65211
...
@@ -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
++
)
{
{
...
...
nxcomp/Control.cpp
View file @
03b65211
...
@@ -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,92 +709,27 @@ Control::~Control()
...
@@ -705,92 +709,27 @@ Control::~Control()
void
Control
::
setProtoStep
(
int
step
)
void
Control
::
setProtoStep
(
int
step
)
{
{
switch
(
step
)
if
(
isValidProtoStep
(
step
)
)
{
{
case
6
:
protoStep_
=
step
;
{
}
protoStep6_
=
1
;
else
protoStep7_
=
0
;
{
protoStep8_
=
0
;
#ifdef PANIC
protoStep9_
=
0
;
*
logofs
<<
"Control: PANIC! Invalid protocol step "
protoStep10_
=
0
;
<<
"with value "
<<
step
<<
".
\n
"
<<
logofs_flush
;
break
;
#endif
}
case
7
:
HandleCleanup
();
{
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
;
protoStep7_
=
1
;
protoStep8_
=
1
;
protoStep9_
=
1
;
protoStep10_
=
0
;
break
;
}
case
10
:
{
protoStep6_
=
1
;
protoStep7_
=
1
;
protoStep8_
=
1
;
protoStep9_
=
1
;
protoStep10_
=
1
;
break
;
}
default
:
{
#ifdef PANIC
*
logofs
<<
"Control: PANIC! Invalid protocol step "
<<
"with value "
<<
step
<<
".
\n
"
<<
logofs_flush
;
#endif
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
{
{
...
...
nxcomp/Control.h
View file @
03b65211
...
@@ -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 */
nxcomp/CreateGC.cpp
View file @
03b65211
...
@@ -146,39 +146,17 @@ void CreateGCStore::updateIdentity(EncodeBuffer &encodeBuffer, const Message *me
...
@@ -146,39 +146,17 @@ 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
;
#endif
#endif
encodeBuffer
.
encodeNewXidValue
(
createGC
->
gcontext
,
clientCache
->
lastId
,
clientCache
->
lastIdCache
,
clientCache
->
gcCache
,
clientCache
->
freeGCCache
);
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
);
encodeBuffer
.
encodeNewXidValue
(
createGC
->
gcontext
,
clientCache
->
lastId
,
clientCache
->
lastIdCache
,
clientCache
->
gcCache
,
clientCache
->
freeGCCache
);
cachedCreateGC
->
gcontext
=
createGC
->
gcontext
;
cachedCreateGC
->
gcontext
=
createGC
->
gcontext
;
}
}
}
void
CreateGCStore
::
updateIdentity
(
DecodeBuffer
&
decodeBuffer
,
const
Message
*
message
,
void
CreateGCStore
::
updateIdentity
(
DecodeBuffer
&
decodeBuffer
,
const
Message
*
message
,
...
@@ -190,37 +168,15 @@ void CreateGCStore::updateIdentity(DecodeBuffer &decodeBuffer, const Message *me
...
@@ -190,37 +168,15 @@ 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
);
createGC
->
gcontext
=
value
;
createGC
->
gcontext
=
value
;
#ifdef TEST
#ifdef TEST
*
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
}
}
}
nxcomp/CreatePixmapCompat.cpp
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#include "CreatePixmapCompat.h"
#include "ClientCache.h"
#include "EncodeBuffer.h"
#include "DecodeBuffer.h"
#include "WriteBuffer.h"
//
// Set the verbosity level.
//
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
//
// Constructors and destructors.
//
CreatePixmapCompatStore
::
CreatePixmapCompatStore
()
:
MessageStore
()
{
enableCache
=
CREATEPIXMAP_ENABLE_CACHE
;
enableData
=
CREATEPIXMAP_ENABLE_DATA
;
enableSplit
=
CREATEPIXMAP_ENABLE_SPLIT
;
enableCompress
=
CREATEPIXMAP_ENABLE_COMPRESS
;
dataLimit
=
CREATEPIXMAP_DATA_LIMIT
;
dataOffset
=
CREATEPIXMAP_DATA_OFFSET
;
cacheSlots
=
CREATEPIXMAP_CACHE_SLOTS
;
cacheThreshold
=
CREATEPIXMAP_CACHE_THRESHOLD
;
cacheLowerThreshold
=
CREATEPIXMAP_CACHE_LOWER_THRESHOLD
;
messages_
->
resize
(
cacheSlots
);
for
(
T_messages
::
iterator
i
=
messages_
->
begin
();
i
<
messages_
->
end
();
i
++
)
{
*
i
=
NULL
;
}
temporary_
=
NULL
;
}
CreatePixmapCompatStore
::~
CreatePixmapCompatStore
()
{
for
(
T_messages
::
iterator
i
=
messages_
->
begin
();
i
<
messages_
->
end
();
i
++
)
{
destroy
(
*
i
);
}
destroy
(
temporary_
);
}
//
// Here are the methods to handle messages' content.
//
int
CreatePixmapCompatStore
::
encodeIdentity
(
EncodeBuffer
&
encodeBuffer
,
const
unsigned
char
*
buffer
,
const
unsigned
int
size
,
int
bigEndian
,
ChannelCache
*
channelCache
)
const
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
encodeBuffer
.
encodeCachedValue
(
*
(
buffer
+
1
),
8
,
clientCache
->
depthCache
);
encodeBuffer
.
encodeDiffCachedValue
(
GetULONG
(
buffer
+
4
,
bigEndian
),
clientCache
->
createPixmapLastId
,
29
,
clientCache
->
createPixmapIdCache
,
4
);
encodeBuffer
.
encodeXidValue
(
GetULONG
(
buffer
+
8
,
bigEndian
),
clientCache
->
drawableCache
);
encodeBuffer
.
encodeCachedValue
(
GetUINT
(
buffer
+
12
,
bigEndian
),
16
,
clientCache
->
createPixmapXCache
,
8
);
encodeBuffer
.
encodeCachedValue
(
GetUINT
(
buffer
+
14
,
bigEndian
),
16
,
clientCache
->
createPixmapYCache
,
8
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded message. Size is "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
return
1
;
}
int
CreatePixmapCompatStore
::
decodeIdentity
(
DecodeBuffer
&
decodeBuffer
,
unsigned
char
*&
buffer
,
unsigned
int
&
size
,
int
bigEndian
,
WriteBuffer
*
writeBuffer
,
ChannelCache
*
channelCache
)
const
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
unsigned
char
cValue
;
unsigned
int
value
;
size
=
16
;
buffer
=
writeBuffer
->
addMessage
(
size
);
decodeBuffer
.
decodeCachedValue
(
cValue
,
8
,
clientCache
->
depthCache
);
*
(
buffer
+
1
)
=
cValue
;
decodeBuffer
.
decodeDiffCachedValue
(
value
,
clientCache
->
createPixmapLastId
,
29
,
clientCache
->
createPixmapIdCache
,
4
);
PutULONG
(
value
,
buffer
+
4
,
bigEndian
);
decodeBuffer
.
decodeXidValue
(
value
,
clientCache
->
drawableCache
);
PutULONG
(
value
,
buffer
+
8
,
bigEndian
);
decodeBuffer
.
decodeCachedValue
(
value
,
16
,
clientCache
->
createPixmapXCache
,
8
);
PutUINT
(
value
,
buffer
+
12
,
bigEndian
);
decodeBuffer
.
decodeCachedValue
(
value
,
16
,
clientCache
->
createPixmapYCache
,
8
);
PutUINT
(
value
,
buffer
+
14
,
bigEndian
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded message. Size is "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
return
1
;
}
int
CreatePixmapCompatStore
::
parseIdentity
(
Message
*
message
,
const
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
{
CreatePixmapCompatMessage
*
createPixmap
=
(
CreatePixmapCompatMessage
*
)
message
;
createPixmap
->
depth
=
*
(
buffer
+
1
);
createPixmap
->
id
=
GetULONG
(
buffer
+
4
,
bigEndian
);
createPixmap
->
drawable
=
GetULONG
(
buffer
+
8
,
bigEndian
);
createPixmap
->
width
=
GetUINT
(
buffer
+
12
,
bigEndian
);
createPixmap
->
height
=
GetUINT
(
buffer
+
14
,
bigEndian
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Parsed identity. Size is "
<<
createPixmap
->
size_
<<
" identity is "
<<
createPixmap
->
i_size_
<<
".
\n
"
<<
logofs_flush
;
#endif
return
1
;
}
int
CreatePixmapCompatStore
::
unparseIdentity
(
const
Message
*
message
,
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
{
CreatePixmapCompatMessage
*
createPixmap
=
(
CreatePixmapCompatMessage
*
)
message
;
*
(
buffer
+
1
)
=
createPixmap
->
depth
;
PutULONG
(
createPixmap
->
id
,
buffer
+
4
,
bigEndian
);
PutULONG
(
createPixmap
->
drawable
,
buffer
+
8
,
bigEndian
);
PutUINT
(
createPixmap
->
width
,
buffer
+
12
,
bigEndian
);
PutUINT
(
createPixmap
->
height
,
buffer
+
14
,
bigEndian
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Unparsed identity. Size is "
<<
createPixmap
->
size_
<<
" identity is "
<<
createPixmap
->
i_size_
<<
".
\n
"
<<
logofs_flush
;
#endif
return
1
;
}
void
CreatePixmapCompatStore
::
dumpIdentity
(
const
Message
*
message
)
const
{
#ifdef DUMP
#ifdef WARNING
*
logofs
<<
name
()
<<
": WARNING! Dump of identity not implemented.
\n
"
<<
logofs_flush
;
#endif
#endif
}
void
CreatePixmapCompatStore
::
identityChecksum
(
const
Message
*
message
,
const
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
{
md5_append
(
md5_state_
,
buffer
+
1
,
1
);
md5_append
(
md5_state_
,
buffer
+
8
,
8
);
}
void
CreatePixmapCompatStore
::
updateIdentity
(
EncodeBuffer
&
encodeBuffer
,
const
Message
*
message
,
const
Message
*
cachedMessage
,
ChannelCache
*
channelCache
)
const
{
CreatePixmapCompatMessage
*
createPixmap
=
(
CreatePixmapCompatMessage
*
)
message
;
CreatePixmapCompatMessage
*
cachedCreatePixmap
=
(
CreatePixmapCompatMessage
*
)
cachedMessage
;
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
encodeBuffer
.
encodeDiffCachedValue
(
createPixmap
->
id
,
clientCache
->
createPixmapLastId
,
29
,
clientCache
->
createPixmapIdCache
,
4
);
cachedCreatePixmap
->
id
=
createPixmap
->
id
;
encodeBuffer
.
encodeXidValue
(
createPixmap
->
drawable
,
clientCache
->
drawableCache
);
cachedCreatePixmap
->
drawable
=
createPixmap
->
drawable
;
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded update. Size is "
<<
createPixmap
->
size_
<<
" identity is "
<<
createPixmap
->
i_size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
void
CreatePixmapCompatStore
::
updateIdentity
(
DecodeBuffer
&
decodeBuffer
,
const
Message
*
message
,
ChannelCache
*
channelCache
)
const
{
CreatePixmapCompatMessage
*
createPixmap
=
(
CreatePixmapCompatMessage
*
)
message
;
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
decodeBuffer
.
decodeDiffCachedValue
(
createPixmap
->
id
,
clientCache
->
createPixmapLastId
,
29
,
clientCache
->
createPixmapIdCache
,
4
);
decodeBuffer
.
decodeXidValue
(
createPixmap
->
drawable
,
clientCache
->
drawableCache
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded update. Size is "
<<
createPixmap
->
size_
<<
" identity is "
<<
createPixmap
->
i_size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
nxcomp/CreatePixmapCompat.h
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef CreatePixmapCompat_H
#define CreatePixmapCompat_H
#include "Message.h"
//
// Set the verbosity level.
//
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
#undef DUMP
//
// Set default values.
//
#define CREATEPIXMAP_ENABLE_CACHE 1
#define CREATEPIXMAP_ENABLE_DATA 0
#define CREATEPIXMAP_ENABLE_SPLIT 0
#define CREATEPIXMAP_ENABLE_COMPRESS 0
#define CREATEPIXMAP_DATA_LIMIT 16
#define CREATEPIXMAP_DATA_OFFSET 16
#define CREATEPIXMAP_CACHE_SLOTS 1000
#define CREATEPIXMAP_CACHE_THRESHOLD 2
#define CREATEPIXMAP_CACHE_LOWER_THRESHOLD 1
//
// The message class.
//
class
CreatePixmapCompatMessage
:
public
Message
{
friend
class
CreatePixmapCompatStore
;
public
:
CreatePixmapCompatMessage
()
{
}
~
CreatePixmapCompatMessage
()
{
}
//
// Put here the fields which constitute
// the 'identity' part of the message.
//
private
:
unsigned
char
depth
;
unsigned
int
id
;
unsigned
int
drawable
;
unsigned
short
width
;
unsigned
short
height
;
};
class
CreatePixmapCompatStore
:
public
MessageStore
{
public
:
CreatePixmapCompatStore
();
virtual
~
CreatePixmapCompatStore
();
virtual
const
char
*
name
()
const
{
return
"CreatePixmapCompat"
;
}
virtual
unsigned
char
opcode
()
const
{
return
X_CreatePixmap
;
}
virtual
unsigned
int
storage
()
const
{
return
sizeof
(
CreatePixmapCompatMessage
);
}
//
// Message handling methods.
//
protected
:
virtual
Message
*
create
()
const
{
return
new
CreatePixmapCompatMessage
();
}
virtual
Message
*
create
(
const
Message
&
message
)
const
{
return
new
CreatePixmapCompatMessage
((
const
CreatePixmapCompatMessage
&
)
message
);
}
virtual
void
destroy
(
Message
*
message
)
const
{
delete
(
CreatePixmapCompatMessage
*
)
message
;
}
virtual
int
encodeIdentity
(
EncodeBuffer
&
encodeBuffer
,
const
unsigned
char
*
buffer
,
const
unsigned
int
size
,
int
bigEndian
,
ChannelCache
*
channelCache
)
const
;
virtual
int
decodeIdentity
(
DecodeBuffer
&
decodeBuffer
,
unsigned
char
*&
buffer
,
unsigned
int
&
size
,
int
bigEndian
,
WriteBuffer
*
writeBuffer
,
ChannelCache
*
channelCache
)
const
;
virtual
int
parseIdentity
(
Message
*
message
,
const
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
;
virtual
int
unparseIdentity
(
const
Message
*
message
,
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
;
virtual
void
updateIdentity
(
EncodeBuffer
&
encodeBuffer
,
const
Message
*
message
,
const
Message
*
cachedMessage
,
ChannelCache
*
channelCache
)
const
;
virtual
void
updateIdentity
(
DecodeBuffer
&
decodeBuffer
,
const
Message
*
message
,
ChannelCache
*
channelCache
)
const
;
virtual
void
identityChecksum
(
const
Message
*
message
,
const
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
;
virtual
void
dumpIdentity
(
const
Message
*
message
)
const
;
};
#endif
/* CreatePixmapCompat_H */
nxcomp/DecodeBuffer.cpp
View file @
03b65211
...
@@ -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,63 +275,25 @@ int DecodeBuffer::decodeCachedValue(unsigned int &value, unsigned int numBits,
...
@@ -277,63 +275,25 @@ 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
))
{
cache
.
insert
(
value
,
IntMask
[
numBits
]);
return
1
;
}
#ifdef PANIC
if
(
decodeValue
(
value
,
numBits
,
blockSize
,
endOkay
))
*
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
{
{
unsigned
int
sameDiff
;
cache
.
insert
(
value
,
IntMask
[
numBits
]);
decodeBoolValue
(
sameDiff
);
if
(
sameDiff
)
{
value
=
cache
.
getLastDiff
(
IntMask
[
numBits
]);
cache
.
insert
(
value
,
IntMask
[
numBits
]);
return
1
;
}
return
1
;
}
else
{
blockSize
=
cache
.
getBlockSize
(
blockSize
);
if
(
decodeValue
(
value
,
numBits
,
blockSize
,
endOkay
))
{
cache
.
insert
(
value
,
IntMask
[
numBits
]);
return
1
;
}
#ifdef PANIC
#ifdef PANIC
*
logofs
<<
"DecodeBuffer: PANIC! Assertion failed. Error [H] "
*
logofs
<<
"DecodeBuffer: PANIC! Assertion failed. Error [H] "
<<
"in decodeCacheValue() with no value found.
\n
"
<<
"in decodeCacheValue() with no value found.
\n
"
<<
logofs_flush
;
<<
logofs_flush
;
#endif
#endif
cerr
<<
"Error"
<<
": Failure decoding data in context [H].
\n
"
;
cerr
<<
"Error"
<<
": Failure decoding data in context [H].
\n
"
;
HandleAbort
();
HandleAbort
();
}
}
}
}
else
else
{
{
...
@@ -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
);
}
nxcomp/DecodeBuffer.h
View file @
03b65211
...
@@ -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
);
...
...
nxcomp/EncodeBuffer.cpp
View file @
03b65211
...
@@ -261,47 +261,14 @@ void EncodeBuffer::encodeCachedValue(unsigned int value, unsigned int numBits,
...
@@ -261,47 +261,14 @@ 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
<<
".
\n
"
<<
logofs_flush
;
<<
".
\n
"
<<
logofs_flush
;
#endif
#endif
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
encodeValue
(
value
,
numBits
,
blockSize
);
*
logofs
<<
"EncodeBuffer: Encoded missed int using "
<<
diffBits
()
<<
" bits out of "
<<
numBits
<<
".
\n
"
<<
logofs_flush
;
#endif
}
}
}
}
}
...
@@ -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
);
}
nxcomp/EncodeBuffer.h
View file @
03b65211
...
@@ -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
);
...
...
nxcomp/FillPoly.cpp
View file @
03b65211
...
@@ -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
;
...
...
nxcomp/FillPoly.h
View file @
03b65211
...
@@ -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
,
...
...
nxcomp/GenericChannel.h
View file @
03b65211
...
@@ -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
;
}
}
...
...
nxcomp/GenericReply.cpp
View file @
03b65211
...
@@ -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
;
...
...
nxcomp/GenericReply.h
View file @
03b65211
...
@@ -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
...
...
nxcomp/GenericRequest.cpp
View file @
03b65211
...
@@ -45,14 +45,9 @@ GenericRequestStore::GenericRequestStore(StaticCompressor *compressor)
...
@@ -45,14 +45,9 @@ 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
;
...
...
nxcomp/GenericRequest.h
View file @
03b65211
...
@@ -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
...
...
nxcomp/GetImageReply.cpp
View file @
03b65211
...
@@ -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
;
...
...
nxcomp/GetImageReply.h
View file @
03b65211
...
@@ -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
...
...
nxcomp/GetPropertyReply.cpp
View file @
03b65211
...
@@ -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
;
...
...
nxcomp/GetPropertyReply.h
View file @
03b65211
...
@@ -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
...
...
nxcomp/ListFontsReply.cpp
View file @
03b65211
...
@@ -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
;
...
...
nxcomp/ListFontsReply.h
View file @
03b65211
...
@@ -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
...
...
nxcomp/Loop.cpp
View file @
03b65211
...
@@ -4466,32 +4466,16 @@ int SetupServiceSockets()
...
@@ -4466,32 +4466,16 @@ int SetupServiceSockets()
else
else
{
{
//
//
// Disable the font server connections if
// Get ready to listen for the font server connections
// they are not supported by the remote
// proxy.
//
//
if
(
useFontSocket
)
if
(
useFontSocket
)
{
{
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
int
port
=
atoi
(
fontPort
);
int
port
=
atoi
(
fontPort
);
if
((
fontFD
=
ListenConnection
(
port
,
"font"
))
<
0
)
if
((
fontFD
=
ListenConnection
(
port
,
"font"
))
<
0
)
{
useFontSocket
=
0
;
}
}
else
{
{
#ifdef WARNING
*
logofs
<<
"Loop: WARNING! Font server connections not supported "
<<
"by the remote proxy.
\n
"
<<
logofs_flush
;
#endif
cerr
<<
"Warning"
<<
": Font server connections not supported "
<<
"by the remote proxy.
\n
"
;
useFontSocket
=
0
;
useFontSocket
=
0
;
}
}
}
}
...
@@ -4510,23 +4494,9 @@ int SetupServiceSockets()
...
@@ -4510,23 +4494,9 @@ int SetupServiceSockets()
if
(
useSlaveSocket
)
if
(
useSlaveSocket
)
{
{
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
if
((
slaveFD
=
ListenConnection
(
slavePort
,
"slave"
))
<
0
)
if
((
slaveFD
=
ListenConnection
(
slavePort
,
"slave"
))
<
0
)
{
useSlaveSocket
=
0
;
}
}
else
{
{
#ifdef WARNING
*
logofs
<<
"Loop: WARNING! Slave connections not supported "
<<
"by the remote proxy.
\n
"
<<
logofs_flush
;
#endif
cerr
<<
"Warning"
<<
": Slave connections not supported "
<<
"by the remote proxy.
\n
"
;
useSlaveSocket
=
0
;
useSlaveSocket
=
0
;
}
}
}
}
...
@@ -7226,8 +7196,11 @@ int SendProxyOptions(int fd)
...
@@ -7226,8 +7196,11 @@ int SendProxyOptions(int fd)
// value and ignore the second.
// value and ignore the second.
//
//
sprintf
(
options
,
"NXPROXY-1.5.0-%i.%i.%i"
,
control
->
LocalVersionMajor
,
sprintf
(
options
,
"NXPROXY-%s-%i.%i.%i"
,
control
->
LocalVersionMinor
,
control
->
LocalVersionPatch
);
control
->
NXPROXY_COMPATIBILITY_VERSION
,
control
->
LocalVersionMajor
,
control
->
LocalVersionMinor
,
control
->
LocalVersionPatch
);
//
//
// If you want to send options from proxy
// If you want to send options from proxy
...
@@ -7306,8 +7279,8 @@ int SendProxyOptions(int fd)
...
@@ -7306,8 +7279,8 @@ int SendProxyOptions(int fd)
// Add the 'strict' option, if needed.
// Add the 'strict' option, if needed.
//
//
if
(
control
->
isProtoStep7
()
==
1
&&
// Since ProtoStep7 (#issue 108)
useStrict
!=
-
1
)
if
(
useStrict
!=
-
1
)
{
{
sprintf
(
options
+
strlen
(
options
),
"strict=%d,"
,
useStrict
);
sprintf
(
options
+
strlen
(
options
),
"strict=%d,"
,
useStrict
);
}
}
...
@@ -7317,8 +7290,8 @@ int SendProxyOptions(int fd)
...
@@ -7317,8 +7290,8 @@ int SendProxyOptions(int fd)
// memory segment.
// memory segment.
//
//
if
(
control
->
isProtoStep7
()
==
1
&&
// Since ProtoStep7 (#issue 108)
*
shsegSizeName
!=
'\0'
)
if
(
*
shsegSizeName
!=
'\0'
)
{
{
sprintf
(
options
+
strlen
(
options
),
"shseg=%s,"
,
shsegSizeName
);
sprintf
(
options
+
strlen
(
options
),
"shseg=%s,"
,
shsegSizeName
);
}
}
...
@@ -12064,9 +12037,12 @@ int SetSession()
...
@@ -12064,9 +12037,12 @@ int SetSession()
// to the agent.
// to the agent.
//
//
if
(
*
sessionType
!=
'\0'
&&
//
(
control
->
isProtoStep8
()
==
1
||
// Since ProtoStep8 (#issue 108) and also
strncmp
(
sessionType
,
"unix-"
,
strlen
(
"unix-"
))
!=
0
))
// with older "unix-" sessions
//
if
(
*
sessionType
!=
'\0'
)
{
{
#ifdef WARNING
#ifdef WARNING
*
logofs
<<
"Loop: WARNING! Unrecognized session type '"
*
logofs
<<
"Loop: WARNING! Unrecognized session type '"
...
@@ -12599,37 +12575,18 @@ int SetVersion()
...
@@ -12599,37 +12575,18 @@ int SetVersion()
}
}
//
//
// Handle
the 1.5.0 versions
. The protocol
// Handle
versions from 3.5.0
. The protocol
// step
6
is the minimum supported version.
// step
10
is the minimum supported version.
//
//
int
step
=
0
;
int
step
=
0
;
if
(
major
==
1
)
if
(
major
==
3
)
{
if
(
minor
==
5
)
{
step
=
6
;
}
}
else
if
(
major
==
2
)
{
step
=
7
;
}
else
if
(
major
==
3
)
{
{
if
(
minor
>=
2
)
if
(
minor
>=
5
)
{
{
step
=
10
;
step
=
10
;
}
}
else
if
(
minor
>
0
||
patch
>
0
)
{
step
=
9
;
}
else
{
step
=
8
;
}
}
}
else
if
(
major
>
3
)
else
if
(
major
>
3
)
{
{
...
@@ -12639,6 +12596,16 @@ int SetVersion()
...
@@ -12639,6 +12596,16 @@ int SetVersion()
if
(
step
==
0
)
if
(
step
==
0
)
{
{
#ifdef PANIC
#ifdef PANIC
*
logofs
<<
"Loop: PANIC! Unable to set the protocol step value from "
<<
"the negotiated protocol version "
<<
major
<<
"."
<<
minor
<<
"."
<<
patch
<<
".
\n
"
<<
logofs_flush
;
#endif
cerr
<<
"Error"
<<
": Unable to set the protocol step value from "
<<
"the negotiated protocol version "
<<
major
<<
"."
<<
minor
<<
"."
<<
patch
<<
".
\n
"
;
#ifdef PANIC
*
logofs
<<
"Loop: PANIC! Incompatible remote version "
*
logofs
<<
"Loop: PANIC! Incompatible remote version "
<<
control
->
RemoteVersionMajor
<<
"."
<<
control
->
RemoteVersionMinor
<<
control
->
RemoteVersionMajor
<<
"."
<<
control
->
RemoteVersionMinor
<<
"."
<<
control
->
RemoteVersionPatch
<<
" with local version "
<<
"."
<<
control
->
RemoteVersionPatch
<<
" with local version "
...
@@ -12702,97 +12669,21 @@ int SetVersion()
...
@@ -12702,97 +12669,21 @@ int SetVersion()
if
(
control
->
ProxyMode
==
proxy_client
)
if
(
control
->
ProxyMode
==
proxy_client
)
{
{
if
(
control
->
isProtoStep8
()
==
0
)
{
if
(
strncmp
(
sessionType
,
"shadow"
,
strlen
(
"shadow"
))
==
0
||
strncmp
(
sessionType
,
"application"
,
strlen
(
"application"
))
==
0
||
strncmp
(
sessionType
,
"console"
,
strlen
(
"console"
))
==
0
||
strncmp
(
sessionType
,
"default"
,
strlen
(
"default"
))
==
0
||
strncmp
(
sessionType
,
"gnome"
,
strlen
(
"gnome"
))
==
0
||
strncmp
(
sessionType
,
"kde"
,
strlen
(
"kde"
))
==
0
||
strncmp
(
sessionType
,
"cde"
,
strlen
(
"cde"
))
==
0
||
strncmp
(
sessionType
,
"xdm"
,
strlen
(
"xdm"
))
==
0
)
{
#if defined(TEST) || defined(INFO)
*
logofs
<<
"Loop: WARNING! Prepending 'unix-' to the "
<<
"name of the session.
\n
"
<<
logofs_flush
;
#endif
char
buffer
[
DEFAULT_STRING_LENGTH
];
snprintf
(
buffer
,
DEFAULT_STRING_LENGTH
-
1
,
"unix-%s"
,
sessionType
);
strcpy
(
sessionType
,
buffer
);
}
}
//
//
// Check if the remote is able to handle
// Since ProtoStep8 (#issue 108)
// the selected pack method.
//
//
// Now it's assumed that the remote is
if
(
control
->
isProtoStep8
()
==
0
)
// able to handle the selected pack
{
// method
if
(
packMethod
==
PACK_ADAPTIVE
||
packMethod
==
PACK_LOSSY
)
{
#ifdef TEST
*
logofs
<<
"Loop: WARNING! Assuming a lossy encoding with "
<<
"an old proxy version.
\n
"
<<
logofs_flush
;
#endif
packMethod
=
PACK_JPEG_16M_COLORS
;
}
else
if
(
packMethod
==
PACK_LOSSLESS
)
{
#ifdef TEST
*
logofs
<<
"Loop: WARNING! Assuming a lossless encoding with "
<<
"an old proxy version.
\n
"
<<
logofs_flush
;
#endif
if
(
control
->
isProtoStep7
()
==
1
)
{
packMethod
=
PACK_RLE_16M_COLORS
;
}
else
{
packMethod
=
PACK_PNG_16M_COLORS
;
}
}
}
//
// If the remote doesn't support the
// selected method use something that
// is compatible.
//
//
if
((
packMethod
==
PACK_RGB_16M_COLORS
||
#ifdef TEST
packMethod
==
PACK_RLE_16M_COLORS
||
*
logofs
<<
__FILE__
<<
" : "
<<
__LINE__
<<
" - "
packMethod
==
PACK_BITMAP_16M_COLORS
)
&&
<<
"step = "
<<
control
->
getProtoStep
()
control
->
isProtoStep7
()
==
0
)
<<
" packMethod = "
<<
packMethod
{
<<
" packQuality = "
<<
packQuality
#ifdef TEST
<<
".
\n
"
<<
logofs_flush
;
*
logofs
<<
"Loop: WARNING! Setting the pack method to '"
#endif
<<
PACK_PNG_16M_COLORS
<<
"' with '"
<<
packMethod
<<
"' unsupported.
\n
"
<<
logofs_flush
;
#endif
packMethod
=
PACK_PNG_16M_COLORS
;
packQuality
=
9
;
}
else
if
(
packMethod
==
PACK_BITMAP_16M_COLORS
&&
control
->
isProtoStep8
()
==
0
)
{
#ifdef TEST
*
logofs
<<
"Loop: WARNING! Setting the pack method to '"
<<
PACK_RLE_16M_COLORS
<<
"' with '"
<<
packMethod
<<
"' unsupported.
\n
"
<<
logofs_flush
;
#endif
packMethod
=
PACK_RLE_16M_COLORS
;
packQuality
=
9
;
}
//
//
// Update the pack method name.
// Update the pack method name.
...
@@ -12803,29 +12694,32 @@ int SetVersion()
...
@@ -12803,29 +12694,32 @@ int SetVersion()
//
//
// At the moment the image cache is not used by the
// At the moment the image cache is not used by the
// agent but we need to take care of the compatibi-
// agent. Proxy versions older than 3.0.0 assumed
// lity with old versions. Proxy versions older than
// that it was enabled and sent specific bits as part
// the 3.0.0 assume that it is enabled and will send
// of the encoding. Conversely, it is advisable to
// specific bits as part of the encoding. Conversely,
// disable the cache right now. By not enabling the
// it is advisable to disable the cache right now.
// the image cache, the house-keeping process will
// By not enabling the image cache, the house-keep-
// only take care of cleaning up the "cache-" direc-
// ing process will only take care of cleaning up
// tories.
// the "cache-" directories.
//
//
if
(
control
->
isProtoStep8
()
==
1
)
//
{
// Considering that compatibility with older versions
#ifdef TEST
// has been set to cover as far as 3.5.0, the cache can
*
logofs
<<
"Loop: Disabling image cache with protocol "
// be disabled at this point without any concern
<<
"step '"
<<
control
->
getProtoStep
()
//
<<
"'.
\n
"
<<
logofs_flush
;
#endif
sprintf
(
imagesSizeName
,
"0"
);
// Since ProtoStep8 (#issue 108)
#ifdef TEST
*
logofs
<<
"Loop: Disabling image cache with protocol "
<<
"step '"
<<
control
->
getProtoStep
()
<<
"'.
\n
"
<<
logofs_flush
;
#endif
control
->
ImageCacheEnableLoad
=
0
;
sprintf
(
imagesSizeName
,
"0"
);
control
->
ImageCacheEnableSave
=
0
;
}
control
->
ImageCacheEnableLoad
=
0
;
control
->
ImageCacheEnableSave
=
0
;
return
1
;
return
1
;
}
}
...
@@ -15805,22 +15699,14 @@ static void handleAlertInLoop()
...
@@ -15805,22 +15699,14 @@ static void handleAlertInLoop()
return
;
return
;
}
}
if
(
lastAlert
.
local
==
0
&&
//
(
lastAlert
.
code
>
LAST_PROTO_STEP_6_ALERT
&&
// Since ProtoStep7 (#issue 108)
control
->
isProtoStep7
()
==
0
))
//
{
// Now the remote proxy should always
//
// be able to handle the alert
// The remote proxy would be unable
//
// to handle the alert.
//
#ifdef WARNING
if
(
lastAlert
.
local
==
0
)
*
logofs
<<
"Loop: WARNING! Ignoring unsupported alert "
<<
"with code '"
<<
lastAlert
.
code
<<
"'.
\n
"
<<
logofs_flush
;
#endif
}
else
if
(
lastAlert
.
local
==
0
)
{
{
if
(
proxy
!=
NULL
)
if
(
proxy
!=
NULL
)
{
{
...
...
nxcomp/Makefile.in
View file @
03b65211
...
@@ -165,7 +165,6 @@ CXXSRC = Loop.cpp \
...
@@ -165,7 +165,6 @@ CXXSRC = Loop.cpp \
BlockCache.cpp
\
BlockCache.cpp
\
BlockCacheSet.cpp
\
BlockCacheSet.cpp
\
StaticCompressor.cpp
\
StaticCompressor.cpp
\
TextCompressor.cpp
\
Unpack.cpp
\
Unpack.cpp
\
Alpha.cpp
\
Alpha.cpp
\
Colormap.cpp
\
Colormap.cpp
\
...
@@ -226,18 +225,7 @@ CXXSRC = Loop.cpp \
...
@@ -226,18 +225,7 @@ CXXSRC = Loop.cpp \
RenderCompositeGlyphs.cpp
\
RenderCompositeGlyphs.cpp
\
RenderFillRectangles.cpp
\
RenderFillRectangles.cpp
\
RenderTrapezoids.cpp
\
RenderTrapezoids.cpp
\
RenderTriangles.cpp
\
RenderTriangles.cpp
PositionCacheCompat.cpp
\
ChangeGCCompat.cpp
\
CreatePixmapCompat.cpp
\
SetUnpackColormapCompat.cpp
\
SetUnpackAlphaCompat.cpp
\
RenderCreatePictureCompat.cpp
\
RenderFreePictureCompat.cpp
\
RenderPictureClipCompat.cpp
\
RenderCreateGlyphSetCompat.cpp
\
RenderCompositeCompat.cpp
\
RenderCompositeGlyphsCompat.cpp
MOBJ
=
$
(
MSRC:.c
=
.o
)
MOBJ
=
$
(
MSRC:.c
=
.o
)
COBJ
=
$
(
CSRC:.c
=
.o
)
COBJ
=
$
(
CSRC:.c
=
.o
)
...
...
nxcomp/Message.cpp
View file @
03b65211
...
@@ -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.
//
//
...
...
nxcomp/Message.h
View file @
03b65211
...
@@ -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.
//
//
...
...
nxcomp/PolyLine.cpp
View file @
03b65211
...
@@ -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
;
...
...
nxcomp/PolyPoint.cpp
View file @
03b65211
...
@@ -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
;
...
...
nxcomp/PositionCacheCompat.cpp
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#include "Control.h"
#include "PositionCacheCompat.h"
PositionCacheCompat
::
PositionCacheCompat
()
{
if
(
control
->
isProtoStep7
()
==
0
)
{
for
(
int
i
=
0
;
i
<
32
;
i
++
)
{
base_
[
i
]
=
new
IntCache
(
8
);
}
slot_
=
0
;
last_
=
0
;
}
}
PositionCacheCompat
::~
PositionCacheCompat
()
{
if
(
control
->
isProtoStep7
()
==
0
)
{
for
(
int
i
=
0
;
i
<
32
;
i
++
)
{
delete
base_
[
i
];
}
}
}
nxcomp/PositionCacheCompat.h
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef PositionCacheCompat_H
#define PositionCacheCompat_H
#include "IntCache.h"
class
PositionCacheCompat
{
friend
class
EncodeBuffer
;
friend
class
DecodeBuffer
;
public
:
PositionCacheCompat
();
~
PositionCacheCompat
();
private
:
IntCache
*
base_
[
32
];
unsigned
int
slot_
;
short
int
last_
;
};
#endif
/* PositionCacheCompat_H */
nxcomp/Proxy.cpp
View file @
03b65211
...
@@ -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,31 +3033,19 @@ int Proxy::handleCloseAllXConnections()
...
@@ -3049,31 +3033,19 @@ 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
*
logofs
<<
"Proxy: Closing down all remote listeners.
\n
"
<<
logofs_flush
;
#endif
if
(
handleControl
(
code_finish_listeners
)
<
0
)
{
return
-
1
;
}
finish_
=
1
;
}
}
else
{
{
#ifdef TEST
#ifdef TEST
*
logofs
<<
"Proxy: WARNING! Not sending unsupported "
*
logofs
<<
"Proxy: Closing down all remote listeners.
\n
"
<<
"'code_finish_listeners' message.
\n
"
<<
logofs_flush
;
<<
logofs_flush
;
#endif
#endif
if
(
handleControl
(
code_finish_listeners
)
<
0
)
{
return
-
1
;
}
finish_
=
1
;
finish_
=
1
;
}
}
...
@@ -4546,15 +4518,8 @@ int Proxy::addTokenCodes(T_proxy_token &token)
...
@@ -4546,15 +4518,8 @@ 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
...
@@ -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,73 +4580,52 @@ int Proxy::handleToken(T_frame_type type)
...
@@ -4609,73 +4580,52 @@ 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.
// We don't want to slow down the sending of
// the X events, X replies and split confir-
// mation events on the X server side, so
// take care only of the generic data token.
//
if
(
control
->
ProxyMode
==
proxy_client
)
{
{
//
statistics
->
updateControlToken
(
tokens_
[
token_control
].
bytes
);
// Send a distinct token for each data type.
// We don't want to slow down the sending of
// the X events, X replies and split confir-
// mation events on the X server side, so
// take care only of the generic data token.
//
if
(
control
->
ProxyMode
==
proxy_client
)
if
(
tokens_
[
token_control
].
bytes
>
tokens_
[
token_control
].
size
)
{
{
statistics
->
updateControlToken
(
tokens_
[
token_control
].
bytes
);
if
(
addTokenCodes
(
tokens_
[
token_control
])
<
0
)
if
(
tokens_
[
token_control
].
bytes
>
tokens_
[
token_control
].
size
)
{
{
if
(
addTokenCodes
(
tokens_
[
token_control
])
<
0
)
return
-
1
;
{
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
}
}
statistics
->
updateSplitToken
(
tokens_
[
token_split
].
bytes
);
#if defined(TEST) || defined(INFO) || defined(TOKEN)
if
(
tokens_
[
token_split
].
bytes
>
tokens_
[
token_split
].
size
)
{
if
(
addTokenCodes
(
tokens_
[
token_split
])
<
0
)
{
return
-
1
;
}
#if defined(TEST) || defined(INFO) || defined(TOKEN)
T_proxy_token
&
token
=
tokens_
[
token_split
];
T_proxy_token
&
token
=
tokens_
[
token_control
];
*
logofs
<<
"Proxy: TOKEN! Token class ["
*
logofs
<<
"Proxy: TOKEN! Token class ["
<<
DumpToken
(
token
.
type
)
<<
"] has now "
<<
DumpToken
(
token
.
type
)
<<
"] has now "
<<
token
.
bytes
<<
" bytes accumulated and "
<<
token
.
bytes
<<
" bytes accumulated and "
<<
token
.
remaining
<<
" tokens remaining.
\n
"
<<
token
.
remaining
<<
" tokens remaining.
\n
"
<<
logofs_flush
;
<<
logofs_flush
;
#endif
#endif
}
}
}
statistics
->
update
DataToken
(
tokens_
[
token_data
].
bytes
);
statistics
->
update
SplitToken
(
tokens_
[
token_split
].
bytes
);
if
(
tokens_
[
token_
data
].
bytes
>
tokens_
[
token_data
].
size
)
if
(
tokens_
[
token_
split
].
bytes
>
tokens_
[
token_split
].
size
)
{
{
if
(
addTokenCodes
(
tokens_
[
token_
data
])
<
0
)
if
(
addTokenCodes
(
tokens_
[
token_
split
])
<
0
)
{
{
return
-
1
;
return
-
1
;
}
}
#if defined(TEST) || defined(INFO) || defined(TOKEN)
#if defined(TEST) || defined(INFO) || defined(TOKEN)
T_proxy_token
&
token
=
tokens_
[
token_
data
];
T_proxy_token
&
token
=
tokens_
[
token_
split
];
*
logofs
<<
"Proxy: TOKEN! Token class ["
*
logofs
<<
"Proxy: TOKEN! Token class ["
<<
DumpToken
(
token
.
type
)
<<
"] has now "
<<
DumpToken
(
token
.
type
)
<<
"] has now "
...
@@ -4685,37 +4635,26 @@ int Proxy::handleToken(T_frame_type type)
...
@@ -4685,37 +4635,26 @@ int Proxy::handleToken(T_frame_type type)
#endif
#endif
}
}
}
}
else
{
//
// Sum everything to the control token.
//
if
(
control
->
ProxyMode
==
proxy_client
)
statistics
->
updateDataToken
(
tokens_
[
token_data
].
bytes
);
{
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
(
tokens_
[
token_data
].
bytes
>
tokens_
[
token_data
].
size
)
{
{
if
(
addTokenCodes
(
tokens_
[
token_control
])
<
0
)
if
(
addTokenCodes
(
tokens_
[
token_data
])
<
0
)
{
{
return
-
1
;
return
-
1
;
}
}
#if defined(TEST) || defined(INFO) || defined(TOKEN)
#if defined(TEST) || defined(INFO) || defined(TOKEN)
T_proxy_token
&
token
=
tokens_
[
token_control
];
T_proxy_token
&
token
=
tokens_
[
token_data
];
*
logofs
<<
"Proxy: TOKEN! Token class ["
*
logofs
<<
"Proxy: TOKEN! Token class ["
<<
DumpToken
(
token
.
type
)
<<
"] has now "
<<
DumpToken
(
token
.
type
)
<<
"] has now "
<<
token
.
bytes
<<
" bytes accumulated and "
<<
token
.
bytes
<<
" bytes accumulated and "
<<
token
.
remaining
<<
" tokens remaining.
\n
"
<<
token
.
remaining
<<
" tokens remaining.
\n
"
<<
logofs_flush
;
<<
logofs_flush
;
#endif
#endif
}
}
}
}
}
}
else
else
...
@@ -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,26 +4866,10 @@ int Proxy::handleLoadVersion(const unsigned char *buffer, int &major,
...
@@ -4964,26 +4866,10 @@ 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
;
}
}
else
if
(
control
->
isProtoStep7
()
==
1
)
{
if
(
major
<
2
)
{
return
-
1
;
}
}
else
{
{
if
(
major
!=
1
&&
minor
!=
4
)
return
-
1
;
{
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
,
...
...
nxcomp/Proxy.h
View file @
03b65211
...
@@ -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
)
...
...
nxcomp/PutImage.cpp
View file @
03b65211
...
@@ -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
);
...
...
nxcomp/PutImage.h
View file @
03b65211
...
@@ -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
...
...
nxcomp/PutPackedImage.cpp
View file @
03b65211
...
@@ -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
);
...
...
nxcomp/PutPackedImage.h
View file @
03b65211
...
@@ -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
//
//
...
...
nxcomp/QueryFontReply.cpp
View file @
03b65211
...
@@ -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
;
...
...
nxcomp/QueryFontReply.h
View file @
03b65211
...
@@ -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
...
...
nxcomp/RenderCompositeCompat.cpp
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
//
// Include the template for
// this message class.
//
#include "RenderCompositeCompat.h"
//
// Set the verbosity level.
//
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
#include MESSAGE_TAGS
//
// Message handling methods.
//
MESSAGE_BEGIN_ENCODE_SIZE
{
//
// Strictly speaking this request doesn't have
// a data part. We just encode the field from
// offset 24 to 36 as they were data using an
// int cache.
//
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded size with value "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_ENCODE_SIZE
MESSAGE_BEGIN_DECODE_SIZE
{
size
=
MESSAGE_OFFSET
+
12
;
buffer
=
writeBuffer
->
addMessage
(
size
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded size with value "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_DECODE_SIZE
MESSAGE_BEGIN_ENCODE_MESSAGE
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
encodeBuffer
.
encodeCachedValue
(
*
(
buffer
+
4
),
8
,
clientCache
->
renderOpCache
);
encodeBuffer
.
encodeXidValue
(
GetULONG
(
buffer
+
8
,
bigEndian
),
clientCache
->
renderSrcPictureCache
);
encodeBuffer
.
encodeXidValue
(
GetULONG
(
buffer
+
12
,
bigEndian
),
clientCache
->
renderSrcPictureCache
);
encodeBuffer
.
encodeXidValue
(
GetULONG
(
buffer
+
16
,
bigEndian
),
clientCache
->
renderSrcPictureCache
);
encodeBuffer
.
encodeDiffCachedValue
(
GetUINT
(
buffer
+
20
,
bigEndian
),
clientCache
->
renderLastX
,
16
,
clientCache
->
renderXCache
,
11
);
encodeBuffer
.
encodeDiffCachedValue
(
GetUINT
(
buffer
+
22
,
bigEndian
),
clientCache
->
renderLastY
,
16
,
clientCache
->
renderYCache
,
11
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded message. Type is "
<<
(
unsigned
int
)
*
(
buffer
+
1
)
<<
" size is "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_ENCODE_MESSAGE
MESSAGE_BEGIN_DECODE_MESSAGE
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
unsigned
int
value
;
*
(
buffer
+
1
)
=
type
;
decodeBuffer
.
decodeCachedValue
(
*
(
buffer
+
4
),
8
,
clientCache
->
renderOpCache
);
decodeBuffer
.
decodeXidValue
(
value
,
clientCache
->
renderSrcPictureCache
);
PutULONG
(
value
,
buffer
+
8
,
bigEndian
);
decodeBuffer
.
decodeXidValue
(
value
,
clientCache
->
renderSrcPictureCache
);
PutULONG
(
value
,
buffer
+
12
,
bigEndian
);
decodeBuffer
.
decodeXidValue
(
value
,
clientCache
->
renderSrcPictureCache
);
PutULONG
(
value
,
buffer
+
16
,
bigEndian
);
decodeBuffer
.
decodeDiffCachedValue
(
value
,
clientCache
->
renderLastX
,
16
,
clientCache
->
renderXCache
,
11
);
PutUINT
(
clientCache
->
renderLastX
,
buffer
+
20
,
bigEndian
);
decodeBuffer
.
decodeDiffCachedValue
(
value
,
clientCache
->
renderLastY
,
16
,
clientCache
->
renderYCache
,
11
);
PutUINT
(
clientCache
->
renderLastY
,
buffer
+
22
,
bigEndian
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded message. Type is "
<<
(
unsigned
int
)
type
<<
" size is "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_DECODE_MESSAGE
MESSAGE_BEGIN_ENCODE_DATA
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
for
(
unsigned
int
i
=
MESSAGE_OFFSET
,
c
=
0
;
i
<
size
;
i
+=
4
)
{
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Encoding long value "
<<
GetULONG
(
buffer
+
i
,
bigEndian
)
<<
" with i = "
<<
i
<<
" c = "
<<
c
<<
".
\n
"
<<
logofs_flush
;
#endif
encodeBuffer
.
encodeCachedValue
(
GetULONG
(
buffer
+
i
,
bigEndian
),
32
,
*
clientCache
->
renderCompositeDataCache
[
c
]);
if
(
++
c
==
3
)
c
=
0
;
}
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded "
<<
size
-
MESSAGE_OFFSET
<<
" bytes of data.
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_ENCODE_DATA
MESSAGE_BEGIN_DECODE_DATA
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
unsigned
int
value
;
for
(
unsigned
int
i
=
MESSAGE_OFFSET
,
c
=
0
;
i
<
size
;
i
+=
4
)
{
decodeBuffer
.
decodeCachedValue
(
value
,
32
,
*
clientCache
->
renderCompositeDataCache
[
c
]);
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Decoded long value "
<<
value
<<
" with i = "
<<
i
<<
" c = "
<<
c
<<
".
\n
"
<<
logofs_flush
;
#endif
PutULONG
(
value
,
buffer
+
i
,
bigEndian
);
if
(
++
c
==
3
)
c
=
0
;
}
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded "
<<
size
-
MESSAGE_OFFSET
<<
" bytes of data.
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_DECODE_DATA
MESSAGE_BEGIN_PARSE_IDENTITY
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
renderExtension
->
data
.
composite
.
type
=
*
(
buffer
+
1
);
renderExtension
->
data
.
composite
.
op
=
*
(
buffer
+
4
);
renderExtension
->
data
.
composite
.
src_id
=
GetULONG
(
buffer
+
8
,
bigEndian
);
renderExtension
->
data
.
composite
.
msk_id
=
GetULONG
(
buffer
+
12
,
bigEndian
);
renderExtension
->
data
.
composite
.
dst_id
=
GetULONG
(
buffer
+
16
,
bigEndian
);
renderExtension
->
data
.
composite
.
src_x
=
GetUINT
(
buffer
+
20
,
bigEndian
);
renderExtension
->
data
.
composite
.
src_y
=
GetUINT
(
buffer
+
22
,
bigEndian
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Parsed identity. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
composite
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_PARSE_IDENTITY
MESSAGE_BEGIN_UNPARSE_IDENTITY
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
*
(
buffer
+
1
)
=
renderExtension
->
data
.
composite
.
type
;
*
(
buffer
+
4
)
=
renderExtension
->
data
.
composite
.
op
;
PutULONG
(
renderExtension
->
data
.
composite
.
src_id
,
buffer
+
8
,
bigEndian
);
PutULONG
(
renderExtension
->
data
.
composite
.
msk_id
,
buffer
+
12
,
bigEndian
);
PutULONG
(
renderExtension
->
data
.
composite
.
dst_id
,
buffer
+
16
,
bigEndian
);
PutUINT
(
renderExtension
->
data
.
composite
.
src_x
,
buffer
+
20
,
bigEndian
);
PutUINT
(
renderExtension
->
data
.
composite
.
src_y
,
buffer
+
22
,
bigEndian
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Unparsed identity. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
composite
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_UNPARSE_IDENTITY
MESSAGE_BEGIN_IDENTITY_CHECKSUM
{
//
// Include minor opcode, size and
// operator in the identity, plus
// the x and y of the source.
//
md5_append
(
md5_state
,
buffer
+
1
,
4
);
md5_append
(
md5_state
,
buffer
+
20
,
4
);
}
MESSAGE_END_IDENTITY_CHECKSUM
MESSAGE_BEGIN_ENCODE_UPDATE
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
RenderExtensionMessage
*
cachedRenderExtension
=
(
RenderExtensionMessage
*
)
cachedMessage
;
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Source "
<<
renderExtension
->
data
.
composite
.
src_id
<<
" mask "
<<
renderExtension
->
data
.
composite
.
msk_id
<<
" destination "
<<
renderExtension
->
data
.
composite
.
msk_id
<<
".
\n
"
<<
logofs_flush
;
#endif
encodeBuffer
.
encodeXidValue
(
renderExtension
->
data
.
composite
.
src_id
,
clientCache
->
renderSrcPictureCache
);
cachedRenderExtension
->
data
.
composite
.
src_id
=
renderExtension
->
data
.
composite
.
src_id
;
encodeBuffer
.
encodeXidValue
(
renderExtension
->
data
.
composite
.
msk_id
,
clientCache
->
renderSrcPictureCache
);
cachedRenderExtension
->
data
.
composite
.
msk_id
=
renderExtension
->
data
.
composite
.
msk_id
;
encodeBuffer
.
encodeXidValue
(
renderExtension
->
data
.
composite
.
dst_id
,
clientCache
->
renderSrcPictureCache
);
cachedRenderExtension
->
data
.
composite
.
dst_id
=
renderExtension
->
data
.
composite
.
dst_id
;
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded update. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
composite
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_ENCODE_UPDATE
MESSAGE_BEGIN_DECODE_UPDATE
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
decodeBuffer
.
decodeXidValue
(
renderExtension
->
data
.
composite
.
src_id
,
clientCache
->
renderSrcPictureCache
);
decodeBuffer
.
decodeXidValue
(
renderExtension
->
data
.
composite
.
msk_id
,
clientCache
->
renderSrcPictureCache
);
decodeBuffer
.
decodeXidValue
(
renderExtension
->
data
.
composite
.
dst_id
,
clientCache
->
renderSrcPictureCache
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded update. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
composite
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_DECODE_UPDATE
nxcomp/RenderCompositeCompat.h
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef RenderCompositeCompat_H
#define RenderCompositeCompat_H
//
// Define the characteristics
// of this message class here.
//
#undef MESSAGE_NAME
#define MESSAGE_NAME "RenderCompositeCompat"
#undef MESSAGE_STORE
#define MESSAGE_STORE RenderCompositeCompatStore
#undef MESSAGE_CLASS
#define MESSAGE_CLASS RenderMinorExtensionStore
#undef MESSAGE_METHODS
#define MESSAGE_METHODS "RenderMinorExtensionMethods.h"
#undef MESSAGE_HEADERS
#define MESSAGE_HEADERS "RenderMinorExtensionHeaders.h"
#undef MESSAGE_TAGS
#define MESSAGE_TAGS "RenderMinorExtensionTags.h"
#undef MESSAGE_OFFSET
#define MESSAGE_OFFSET 24
#undef MESSAGE_HAS_SIZE
#define MESSAGE_HAS_SIZE 1
#undef MESSAGE_HAS_DATA
#define MESSAGE_HAS_DATA 1
#undef MESSAGE_HAS_FILTER
#define MESSAGE_HAS_FILTER 0
//
// Declare the message class.
//
#include MESSAGE_HEADERS
class
MESSAGE_STORE
:
public
MESSAGE_CLASS
{
public
:
virtual
const
char
*
name
()
const
{
return
MESSAGE_NAME
;
}
virtual
int
identitySize
(
const
unsigned
char
*
buffer
,
unsigned
int
size
)
{
return
MESSAGE_OFFSET
;
}
#include MESSAGE_METHODS
};
#endif
/* RenderCompositeCompat_H */
nxcomp/RenderCompositeGlyphs.cpp
View file @
03b65211
...
@@ -102,26 +102,14 @@ MESSAGE_BEGIN_ENCODE_MESSAGE
...
@@ -102,26 +102,14 @@ 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
);
encodeBuffer
.
encodeDiffCachedValue
(
src_y
,
clientCache
->
renderGlyphY
,
16
,
clientCache
->
renderGlyphYCache
,
11
);
}
else
{
encodeBuffer
.
encodeDiffCachedValue
(
src_x
,
clientCache
->
renderLastX
,
16
,
clientCache
->
renderXCache
,
11
);
encodeBuffer
.
encodeDiffCachedValue
(
src_y
,
encodeBuffer
.
encodeDiffCachedValue
(
src_y
,
clientCache
->
renderLastY
,
16
,
clientCache
->
renderGlyphY
,
16
,
clientCache
->
renderYCache
,
11
);
clientCache
->
renderGlyphYCache
,
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,32 +220,20 @@ MESSAGE_BEGIN_DECODE_MESSAGE
...
@@ -232,32 +220,20 @@ 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
);
decodeBuffer
.
decodeDiffCachedValue
(
src_y
,
clientCache
->
renderGlyphY
,
16
,
clientCache
->
renderGlyphYCache
,
11
);
}
else
{
decodeBuffer
.
decodeDiffCachedValue
(
src_x
,
clientCache
->
renderLastX
,
16
,
clientCache
->
renderXCache
,
11
);
decodeBuffer
.
decodeDiffCachedValue
(
src_y
,
decodeBuffer
.
decodeDiffCachedValue
(
src_y
,
clientCache
->
renderLastY
,
16
,
clientCache
->
renderGlyphY
,
16
,
clientCache
->
renderYCache
,
11
);
clientCache
->
renderGlyphYCache
,
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,42 +446,22 @@ MESSAGE_BEGIN_ENCODE_UPDATE
...
@@ -470,42 +446,22 @@ 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
;
encodeBuffer
.
encodeDiffCachedValue
(
value
,
previous
,
16
,
clientCache
->
renderGlyphXCache
,
11
);
cachedRenderExtension
->
data
.
composite_glyphs
.
src_x
=
value
;
encodeBuffer
.
encodeDiffCachedValue
(
value
,
previous
,
16
,
clientCache
->
renderGlyphXCache
,
11
);
value
=
renderExtension
->
data
.
composite_glyphs
.
src_y
;
cachedRenderExtension
->
data
.
composite_glyphs
.
src_x
=
value
;
previous
=
cachedRenderExtension
->
data
.
composite_glyphs
.
src_y
;
encodeBuffer
.
encodeDiffCachedValue
(
value
,
previous
,
16
,
value
=
renderExtension
->
data
.
composite_glyphs
.
src_y
;
clientCache
->
renderGlyphYCache
,
11
)
;
previous
=
cachedRenderExtension
->
data
.
composite_glyphs
.
src_y
;
cachedRenderExtension
->
data
.
composite_glyphs
.
src_y
=
value
;
encodeBuffer
.
encodeDiffCachedValue
(
value
,
previous
,
16
,
}
clientCache
->
renderGlyphYCache
,
11
);
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
;
cachedRenderExtension
->
data
.
composite_glyphs
.
src_y
=
value
;
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,41 +557,23 @@ MESSAGE_BEGIN_DECODE_UPDATE
...
@@ -601,41 +557,23 @@ 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
,
clientCache
->
renderGlyphXCache
,
11
);
renderExtension
->
data
.
composite_glyphs
.
src_x
=
value
;
previous
=
renderExtension
->
data
.
composite_glyphs
.
src_y
;
decodeBuffer
.
decodeDiffCachedValue
(
value
,
previous
,
16
,
clientCache
->
renderGlyphYCache
,
11
);
renderExtension
->
data
.
composite_glyphs
.
src_y
=
value
;
decodeBuffer
.
decodeDiffCachedValue
(
value
,
previous
,
16
,
}
clientCache
->
renderGlyphXCache
,
11
);
else
{
previous
=
renderExtension
->
data
.
composite_glyphs
.
src_x
;
decodeBuffer
.
decodeDiffCachedValue
(
value
,
previous
,
16
,
renderExtension
->
data
.
composite_glyphs
.
src_x
=
value
;
clientCache
->
renderXCache
,
11
);
renderExtension
->
data
.
composite_glyphs
.
src_x
=
value
;
previous
=
renderExtension
->
data
.
composite_glyphs
.
src_y
;
previous
=
renderExtension
->
data
.
composite_glyphs
.
src_y
;
decodeBuffer
.
decodeDiffCachedValue
(
value
,
previous
,
16
,
clientCache
->
renderGlyphYCache
,
11
);
decodeBuffer
.
decodeDiffCachedValue
(
value
,
previous
,
16
,
renderExtension
->
data
.
composite_glyphs
.
src_y
=
value
;
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.
...
...
nxcomp/RenderCompositeGlyphs.h
View file @
03b65211
...
@@ -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
);
}
}
...
...
nxcomp/RenderCompositeGlyphsCompat.cpp
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
//
// Include the template for
// this message class.
//
#include "RenderCompositeGlyphsCompat.h"
//
// Set the verbosity level.
//
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
#include MESSAGE_TAGS
//
// Message handling methods.
//
MESSAGE_BEGIN_ENCODE_SIZE
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
//
// The offset points 8 bytes after
// the beginning of the data part.
//
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Encoding value "
<<
((
size
-
(
MESSAGE_OFFSET
-
8
))
>>
2
)
<<
".
\n
"
<<
logofs_flush
;
#endif
encodeBuffer
.
encodeCachedValue
((
size
-
(
MESSAGE_OFFSET
-
8
))
>>
2
,
16
,
clientCache
->
renderLengthCache
,
5
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded size with value "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_ENCODE_SIZE
MESSAGE_BEGIN_DECODE_SIZE
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
decodeBuffer
.
decodeCachedValue
(
size
,
16
,
clientCache
->
renderLengthCache
,
5
);
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Decoded value "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
size
=
(
MESSAGE_OFFSET
-
8
)
+
(
size
<<
2
);
buffer
=
writeBuffer
->
addMessage
(
size
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded size with value "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_DECODE_SIZE
MESSAGE_BEGIN_ENCODE_MESSAGE
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
encodeBuffer
.
encodeCachedValue
(
*
(
buffer
+
4
),
8
,
clientCache
->
renderOpCache
);
encodeBuffer
.
encodeXidValue
(
GetULONG
(
buffer
+
8
,
bigEndian
),
clientCache
->
renderSrcPictureCache
);
encodeBuffer
.
encodeXidValue
(
GetULONG
(
buffer
+
12
,
bigEndian
),
clientCache
->
renderSrcPictureCache
);
encodeBuffer
.
encodeCachedValue
(
GetULONG
(
buffer
+
16
,
bigEndian
),
32
,
clientCache
->
renderFormatCache
);
encodeBuffer
.
encodeCachedValue
(
GetULONG
(
buffer
+
20
,
bigEndian
),
29
,
clientCache
->
renderGlyphSetCache
);
encodeBuffer
.
encodeDiffCachedValue
(
GetUINT
(
buffer
+
24
,
bigEndian
),
clientCache
->
renderLastX
,
16
,
clientCache
->
renderXCache
,
11
);
encodeBuffer
.
encodeDiffCachedValue
(
GetUINT
(
buffer
+
26
,
bigEndian
),
clientCache
->
renderLastY
,
16
,
clientCache
->
renderYCache
,
11
);
//
// Try to save as many bits as possible by
// encoding the information about the first
// set of glyphs.
//
if
(
size
>=
MESSAGE_OFFSET
)
{
unsigned
int
numGlyphs
=
*
(
buffer
+
28
);
encodeBuffer
.
encodeCachedValue
(
numGlyphs
,
8
,
clientCache
->
renderNumGlyphsCache
);
encodeBuffer
.
encodeCachedValue
(
GetUINT
(
buffer
+
32
,
bigEndian
),
16
,
clientCache
->
renderWidthCache
,
11
);
encodeBuffer
.
encodeCachedValue
(
GetUINT
(
buffer
+
34
,
bigEndian
),
16
,
clientCache
->
renderHeightCache
,
11
);
//
// Only manage the first set of glyphs,
// that is in most cases the only one.
//
switch
(
*
(
buffer
+
1
))
{
case
X_RenderCompositeGlyphs8
:
{
if
(
numGlyphs
&
0x03
)
{
memset
((
unsigned
char
*
)
buffer
+
MESSAGE_OFFSET
+
numGlyphs
,
'\0'
,
RoundUp4
(
numGlyphs
)
-
numGlyphs
);
}
break
;
}
case
X_RenderCompositeGlyphs16
:
{
if
(
numGlyphs
&
0x01
)
{
memset
((
unsigned
char
*
)
buffer
+
MESSAGE_OFFSET
+
(
numGlyphs
*
2
),
'\0'
,
RoundUp4
(
numGlyphs
*
2
)
-
numGlyphs
*
2
);
}
break
;
}
}
#ifdef TEST
if
(
*
(
buffer
+
(
size
-
1
))
!=
'\0'
)
{
*
logofs
<<
name
()
<<
": WARNING! Final byte is non-zero with size "
<<
size
<<
" and "
<<
(
unsigned
int
)
*
(
buffer
+
28
)
<<
" glyphs.
\n
"
<<
logofs_flush
;
}
else
{
*
logofs
<<
name
()
<<
": Final byte is zero with size "
<<
size
<<
" and "
<<
(
unsigned
int
)
*
(
buffer
+
28
)
<<
" glyphs.
\n
"
<<
logofs_flush
;
}
#endif
}
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded message. Type is "
<<
(
unsigned
int
)
*
(
buffer
+
1
)
<<
" size is "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_ENCODE_MESSAGE
MESSAGE_BEGIN_DECODE_MESSAGE
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
unsigned
int
value
;
*
(
buffer
+
1
)
=
type
;
decodeBuffer
.
decodeCachedValue
(
*
(
buffer
+
4
),
8
,
clientCache
->
renderOpCache
);
decodeBuffer
.
decodeXidValue
(
value
,
clientCache
->
renderSrcPictureCache
);
PutULONG
(
value
,
buffer
+
8
,
bigEndian
);
decodeBuffer
.
decodeXidValue
(
value
,
clientCache
->
renderSrcPictureCache
);
PutULONG
(
value
,
buffer
+
12
,
bigEndian
);
decodeBuffer
.
decodeCachedValue
(
value
,
32
,
clientCache
->
renderFormatCache
);
PutULONG
(
value
,
buffer
+
16
,
bigEndian
);
decodeBuffer
.
decodeCachedValue
(
value
,
29
,
clientCache
->
renderGlyphSetCache
);
PutULONG
(
value
,
buffer
+
20
,
bigEndian
);
decodeBuffer
.
decodeDiffCachedValue
(
value
,
clientCache
->
renderLastX
,
16
,
clientCache
->
renderXCache
,
11
);
PutUINT
(
clientCache
->
renderLastX
,
buffer
+
24
,
bigEndian
);
decodeBuffer
.
decodeDiffCachedValue
(
value
,
clientCache
->
renderLastY
,
16
,
clientCache
->
renderYCache
,
11
);
PutUINT
(
clientCache
->
renderLastY
,
buffer
+
26
,
bigEndian
);
if
(
size
>=
MESSAGE_OFFSET
)
{
decodeBuffer
.
decodeCachedValue
(
value
,
8
,
clientCache
->
renderNumGlyphsCache
);
*
(
buffer
+
28
)
=
value
;
decodeBuffer
.
decodeCachedValue
(
value
,
16
,
clientCache
->
renderWidthCache
,
11
);
PutUINT
(
value
,
buffer
+
32
,
bigEndian
);
decodeBuffer
.
decodeCachedValue
(
value
,
16
,
clientCache
->
renderHeightCache
,
11
);
PutUINT
(
value
,
buffer
+
34
,
bigEndian
);
}
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded message. Type is "
<<
(
unsigned
int
)
type
<<
" size is "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_DECODE_MESSAGE
MESSAGE_BEGIN_ENCODE_DATA
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
unsigned
int
value
;
switch
(
*
(
buffer
+
1
))
{
case
X_RenderCompositeGlyphs8
:
{
clientCache
->
renderTextCompressor
.
reset
();
const
unsigned
char
*
next
=
buffer
+
MESSAGE_OFFSET
;
for
(
unsigned
int
i
=
MESSAGE_OFFSET
;
i
<
size
;
i
++
)
{
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Encoding char with i = "
<<
i
<<
".
\n
"
<<
logofs_flush
;
#endif
clientCache
->
renderTextCompressor
.
encodeChar
(
*
next
++
,
encodeBuffer
);
}
break
;
}
case
X_RenderCompositeGlyphs16
:
{
for
(
unsigned
int
i
=
MESSAGE_OFFSET
;
i
<
size
;
i
+=
2
)
{
value
=
GetUINT
(
buffer
+
i
,
bigEndian
);
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Encoding short with i = "
<<
i
<<
".
\n
"
<<
logofs_flush
;
#endif
encodeBuffer
.
encodeCachedValue
(
value
,
16
,
*
clientCache
->
renderCompositeGlyphsDataCache
[
clientCache
->
renderLastCompositeGlyphsData
]);
clientCache
->
renderLastCompositeGlyphsData
=
value
%
16
;
}
break
;
}
default
:
{
for
(
unsigned
int
i
=
MESSAGE_OFFSET
;
i
<
size
;
i
+=
4
)
{
value
=
GetULONG
(
buffer
+
i
,
bigEndian
);
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Encoding long with i = "
<<
i
<<
".
\n
"
<<
logofs_flush
;
#endif
encodeBuffer
.
encodeCachedValue
(
value
,
32
,
*
clientCache
->
renderCompositeGlyphsDataCache
[
clientCache
->
renderLastCompositeGlyphsData
]);
clientCache
->
renderLastCompositeGlyphsData
=
value
%
16
;
}
break
;
}
}
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded "
<<
size
-
MESSAGE_OFFSET
<<
" bytes of data.
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_ENCODE_DATA
MESSAGE_BEGIN_DECODE_DATA
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
unsigned
int
value
;
switch
(
*
(
buffer
+
1
))
{
case
X_RenderCompositeGlyphs8
:
{
clientCache
->
renderTextCompressor
.
reset
();
unsigned
char
*
next
=
buffer
+
MESSAGE_OFFSET
;
for
(
unsigned
int
i
=
MESSAGE_OFFSET
;
i
<
size
;
i
++
)
{
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Decoding char with i = "
<<
i
<<
".
\n
"
<<
logofs_flush
;
#endif
*
next
++
=
clientCache
->
renderTextCompressor
.
decodeChar
(
decodeBuffer
);
}
break
;
}
case
X_RenderCompositeGlyphs16
:
{
for
(
unsigned
int
i
=
MESSAGE_OFFSET
;
i
<
size
;
i
+=
2
)
{
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Decoding short with i = "
<<
i
<<
".
\n
"
<<
logofs_flush
;
#endif
decodeBuffer
.
decodeCachedValue
(
value
,
16
,
*
clientCache
->
renderCompositeGlyphsDataCache
[
clientCache
->
renderLastCompositeGlyphsData
]);
PutUINT
(
value
,
buffer
+
i
,
bigEndian
);
clientCache
->
renderLastCompositeGlyphsData
=
value
%
16
;
}
break
;
}
default
:
{
for
(
unsigned
int
i
=
MESSAGE_OFFSET
;
i
<
size
;
i
+=
4
)
{
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Decoding long with i = "
<<
i
<<
".
\n
"
<<
logofs_flush
;
#endif
decodeBuffer
.
decodeCachedValue
(
value
,
32
,
*
clientCache
->
renderCompositeGlyphsDataCache
[
clientCache
->
renderLastCompositeGlyphsData
]);
PutULONG
(
value
,
buffer
+
i
,
bigEndian
);
clientCache
->
renderLastCompositeGlyphsData
=
value
%
16
;
}
break
;
}
}
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded "
<<
size
-
MESSAGE_OFFSET
<<
" bytes of data.
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_DECODE_DATA
MESSAGE_BEGIN_PARSE_IDENTITY
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
renderExtension
->
data
.
composite_glyphs_compat
.
type
=
*
(
buffer
+
1
);
renderExtension
->
data
.
composite_glyphs_compat
.
op
=
*
(
buffer
+
4
);
renderExtension
->
data
.
composite_glyphs_compat
.
src_id
=
GetULONG
(
buffer
+
8
,
bigEndian
);
renderExtension
->
data
.
composite_glyphs_compat
.
dst_id
=
GetULONG
(
buffer
+
12
,
bigEndian
);
renderExtension
->
data
.
composite_glyphs_compat
.
format
=
GetULONG
(
buffer
+
16
,
bigEndian
);
renderExtension
->
data
.
composite_glyphs_compat
.
set_id
=
GetULONG
(
buffer
+
20
,
bigEndian
);
renderExtension
->
data
.
composite_glyphs_compat
.
src_x
=
GetUINT
(
buffer
+
24
,
bigEndian
);
renderExtension
->
data
.
composite_glyphs_compat
.
src_y
=
GetUINT
(
buffer
+
26
,
bigEndian
);
if
(
size
>=
MESSAGE_OFFSET
)
{
renderExtension
->
data
.
composite_glyphs_compat
.
num_elm
=
*
(
buffer
+
28
);
renderExtension
->
data
.
composite_glyphs_compat
.
delta_x
=
GetUINT
(
buffer
+
32
,
bigEndian
);
renderExtension
->
data
.
composite_glyphs_compat
.
delta_y
=
GetUINT
(
buffer
+
34
,
bigEndian
);
}
#ifdef TEST
*
logofs
<<
name
()
<<
": Parsed identity. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
composite_glyphs_compat
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
" identity size "
<<
renderExtension
->
i_size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_PARSE_IDENTITY
MESSAGE_BEGIN_UNPARSE_IDENTITY
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
*
(
buffer
+
1
)
=
renderExtension
->
data
.
composite_glyphs_compat
.
type
;
*
(
buffer
+
4
)
=
renderExtension
->
data
.
composite_glyphs_compat
.
op
;
PutULONG
(
renderExtension
->
data
.
composite_glyphs_compat
.
src_id
,
buffer
+
8
,
bigEndian
);
PutULONG
(
renderExtension
->
data
.
composite_glyphs_compat
.
dst_id
,
buffer
+
12
,
bigEndian
);
PutULONG
(
renderExtension
->
data
.
composite_glyphs_compat
.
format
,
buffer
+
16
,
bigEndian
);
PutULONG
(
renderExtension
->
data
.
composite_glyphs_compat
.
set_id
,
buffer
+
20
,
bigEndian
);
PutUINT
(
renderExtension
->
data
.
composite_glyphs_compat
.
src_x
,
buffer
+
24
,
bigEndian
);
PutUINT
(
renderExtension
->
data
.
composite_glyphs_compat
.
src_y
,
buffer
+
26
,
bigEndian
);
if
(
size
>=
MESSAGE_OFFSET
)
{
*
(
buffer
+
28
)
=
renderExtension
->
data
.
composite_glyphs_compat
.
num_elm
;
PutUINT
(
renderExtension
->
data
.
composite_glyphs_compat
.
delta_x
,
buffer
+
32
,
bigEndian
);
PutUINT
(
renderExtension
->
data
.
composite_glyphs_compat
.
delta_y
,
buffer
+
34
,
bigEndian
);
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Len is "
<<
(
unsigned
int
)
*
(
buffer
+
28
)
<<
" delta X is "
<<
GetUINT
(
buffer
+
32
,
bigEndian
)
<<
" delta Y is "
<<
GetUINT
(
buffer
+
34
,
bigEndian
)
<<
".
\n
"
<<
logofs_flush
;
*
logofs
<<
name
()
<<
": Pad 1 is "
<<
(
unsigned
int
)
*
(
buffer
+
29
)
<<
" pad 2 and 3 are "
<<
GetUINT
(
buffer
+
30
,
bigEndian
)
<<
".
\n
"
<<
logofs_flush
;
#endif
}
#ifdef TEST
*
logofs
<<
name
()
<<
": Unparsed identity. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
composite_glyphs_compat
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
" identity size "
<<
renderExtension
->
i_size_
<<
".
\n
"
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_UNPARSE_IDENTITY
MESSAGE_BEGIN_IDENTITY_CHECKSUM
{
//
// Include minor opcode, size and
// the composite operator in the
// identity.
//
md5_append
(
md5_state
,
buffer
+
1
,
4
);
//
// Include the format and the source
// x and y fields.
//
md5_append
(
md5_state
,
buffer
+
16
,
4
);
md5_append
(
md5_state
,
buffer
+
24
,
4
);
//
// Include the number of glyphs.
//
if
(
size
>=
MESSAGE_OFFSET
)
{
md5_append
(
md5_state
,
buffer
+
28
,
1
);
}
}
MESSAGE_END_IDENTITY_CHECKSUM
MESSAGE_BEGIN_ENCODE_UPDATE
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
RenderExtensionMessage
*
cachedRenderExtension
=
(
RenderExtensionMessage
*
)
cachedMessage
;
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
encodeBuffer
.
encodeXidValue
(
renderExtension
->
data
.
composite_glyphs_compat
.
src_id
,
clientCache
->
renderSrcPictureCache
);
cachedRenderExtension
->
data
.
composite_glyphs_compat
.
src_id
=
renderExtension
->
data
.
composite_glyphs_compat
.
src_id
;
encodeBuffer
.
encodeXidValue
(
renderExtension
->
data
.
composite_glyphs_compat
.
dst_id
,
clientCache
->
renderSrcPictureCache
);
cachedRenderExtension
->
data
.
composite_glyphs_compat
.
dst_id
=
renderExtension
->
data
.
composite_glyphs_compat
.
dst_id
;
encodeBuffer
.
encodeCachedValue
(
renderExtension
->
data
.
composite_glyphs_compat
.
set_id
,
29
,
clientCache
->
renderGlyphSetCache
);
cachedRenderExtension
->
data
.
composite_glyphs_compat
.
set_id
=
renderExtension
->
data
.
composite_glyphs_compat
.
set_id
;
if
(
renderExtension
->
size_
>=
MESSAGE_OFFSET
)
{
encodeBuffer
.
encodeCachedValue
(
renderExtension
->
data
.
composite_glyphs_compat
.
delta_x
,
16
,
clientCache
->
renderWidthCache
,
11
);
cachedRenderExtension
->
data
.
composite_glyphs_compat
.
delta_x
=
renderExtension
->
data
.
composite_glyphs_compat
.
delta_x
;
encodeBuffer
.
encodeCachedValue
(
renderExtension
->
data
.
composite_glyphs_compat
.
delta_y
,
16
,
clientCache
->
renderHeightCache
,
11
);
cachedRenderExtension
->
data
.
composite_glyphs_compat
.
delta_y
=
renderExtension
->
data
.
composite_glyphs_compat
.
delta_y
;
}
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded update. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
composite_glyphs_compat
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_ENCODE_UPDATE
MESSAGE_BEGIN_DECODE_UPDATE
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
decodeBuffer
.
decodeXidValue
(
renderExtension
->
data
.
composite_glyphs_compat
.
src_id
,
clientCache
->
renderSrcPictureCache
);
decodeBuffer
.
decodeXidValue
(
renderExtension
->
data
.
composite_glyphs_compat
.
dst_id
,
clientCache
->
renderSrcPictureCache
);
decodeBuffer
.
decodeCachedValue
(
renderExtension
->
data
.
composite_glyphs_compat
.
set_id
,
29
,
clientCache
->
renderGlyphSetCache
);
if
(
renderExtension
->
size_
>=
MESSAGE_OFFSET
)
{
unsigned
int
value
;
decodeBuffer
.
decodeCachedValue
(
value
,
16
,
clientCache
->
renderWidthCache
,
11
);
renderExtension
->
data
.
composite_glyphs_compat
.
delta_x
=
value
;
decodeBuffer
.
decodeCachedValue
(
value
,
16
,
clientCache
->
renderHeightCache
,
11
);
renderExtension
->
data
.
composite_glyphs_compat
.
delta_y
=
value
;
}
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded update. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
composite_glyphs_compat
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_DECODE_UPDATE
nxcomp/RenderCompositeGlyphsCompat.h
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef RenderCompositeGlyphsCompat_H
#define RenderCompositeGlyphsCompat_H
//
// Define the characteristics
// of this message class here.
//
#undef MESSAGE_NAME
#define MESSAGE_NAME "RenderCompositeGlyphsCompat"
#undef MESSAGE_STORE
#define MESSAGE_STORE RenderCompositeGlyphsCompatStore
#undef MESSAGE_CLASS
#define MESSAGE_CLASS RenderMinorExtensionStore
#undef MESSAGE_METHODS
#define MESSAGE_METHODS "RenderMinorExtensionMethods.h"
#undef MESSAGE_HEADERS
#define MESSAGE_HEADERS "RenderMinorExtensionHeaders.h"
#undef MESSAGE_TAGS
#define MESSAGE_TAGS "RenderMinorExtensionTags.h"
#undef MESSAGE_OFFSET
#define MESSAGE_OFFSET 36
#undef MESSAGE_HAS_SIZE
#define MESSAGE_HAS_SIZE 1
#undef MESSAGE_HAS_DATA
#define MESSAGE_HAS_DATA 1
#undef MESSAGE_HAS_FILTER
#define MESSAGE_HAS_FILTER 0
//
// Declare the message class.
//
#include MESSAGE_HEADERS
class
MESSAGE_STORE
:
public
MESSAGE_CLASS
{
public
:
virtual
const
char
*
name
()
const
{
return
MESSAGE_NAME
;
}
virtual
int
identitySize
(
const
unsigned
char
*
buffer
,
unsigned
int
size
)
{
return
(
size
>=
MESSAGE_OFFSET
?
MESSAGE_OFFSET
:
size
);
}
#include MESSAGE_METHODS
};
#endif
/* RenderCompositeGlyphsCompat_H */
nxcomp/RenderCreateGlyphSetCompat.cpp
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
//
// Include the template for
// this message class.
//
#include "RenderCreateGlyphSetCompat.h"
//
// Set the verbosity level.
//
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
#include MESSAGE_TAGS
//
// Message handling methods.
//
MESSAGE_BEGIN_ENCODE_SIZE
{
//
// Strictly speaking this request doesn't have
// a data part. We encode the fields past the
// offset as they were data. An improvement
// would be to encode the format field using
// the cache.
//
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded size with value "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_ENCODE_SIZE
MESSAGE_BEGIN_DECODE_SIZE
{
size
=
MESSAGE_OFFSET
+
4
;
buffer
=
writeBuffer
->
addMessage
(
size
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded size with value "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_DECODE_SIZE
MESSAGE_BEGIN_ENCODE_MESSAGE
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
encodeBuffer
.
encodeDiffCachedValue
(
GetULONG
(
buffer
+
4
,
bigEndian
),
clientCache
->
renderLastId
,
29
,
clientCache
->
renderIdCache
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded message. Type is "
<<
(
unsigned
int
)
*
(
buffer
+
1
)
<<
" size is "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_ENCODE_MESSAGE
MESSAGE_BEGIN_DECODE_MESSAGE
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
unsigned
int
value
;
*
(
buffer
+
1
)
=
type
;
decodeBuffer
.
decodeDiffCachedValue
(
value
,
clientCache
->
renderLastId
,
29
,
clientCache
->
renderIdCache
);
PutULONG
(
value
,
buffer
+
4
,
bigEndian
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded message. Type is "
<<
(
unsigned
int
)
type
<<
" size is "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_DECODE_MESSAGE
MESSAGE_BEGIN_ENCODE_DATA
{
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Glyphset is "
<<
GetULONG
(
buffer
+
4
,
bigEndian
)
<<
".
\n
"
<<
logofs_flush
;
if
(
size
>
MESSAGE_OFFSET
)
{
*
logofs
<<
name
()
<<
": Format is "
<<
GetULONG
(
buffer
+
8
,
bigEndian
)
<<
".
\n
"
<<
logofs_flush
;
}
if
(
size
>
MESSAGE_OFFSET
+
4
)
{
*
logofs
<<
name
()
<<
": WARNING! Unexpected size "
<<
size
<<
".
\n
"
<<
logofs_flush
;
}
#endif
encodeLongData
(
encodeBuffer
,
buffer
,
MESSAGE_OFFSET
,
size
,
bigEndian
,
channelCache
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded "
<<
size
-
MESSAGE_OFFSET
<<
" bytes of data.
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_ENCODE_DATA
MESSAGE_BEGIN_DECODE_DATA
{
decodeLongData
(
decodeBuffer
,
buffer
,
MESSAGE_OFFSET
,
size
,
bigEndian
,
channelCache
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded "
<<
size
-
MESSAGE_OFFSET
<<
" bytes of data.
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_DECODE_DATA
MESSAGE_BEGIN_PARSE_IDENTITY
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
renderExtension
->
data
.
create_set
.
type
=
*
(
buffer
+
1
);
renderExtension
->
data
.
create_set
.
set_id
=
GetULONG
(
buffer
+
4
,
bigEndian
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Parsed identity. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
create_set
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_PARSE_IDENTITY
MESSAGE_BEGIN_UNPARSE_IDENTITY
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
*
(
buffer
+
1
)
=
renderExtension
->
data
.
create_set
.
type
;
PutULONG
(
renderExtension
->
data
.
create_set
.
set_id
,
buffer
+
4
,
bigEndian
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Unparsed identity. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
create_set
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_UNPARSE_IDENTITY
MESSAGE_BEGIN_IDENTITY_CHECKSUM
{
md5_append
(
md5_state
,
buffer
+
1
,
3
);
}
MESSAGE_END_IDENTITY_CHECKSUM
MESSAGE_BEGIN_ENCODE_UPDATE
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
RenderExtensionMessage
*
cachedRenderExtension
=
(
RenderExtensionMessage
*
)
cachedMessage
;
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
encodeBuffer
.
encodeDiffCachedValue
(
renderExtension
->
data
.
create_set
.
set_id
,
clientCache
->
renderLastId
,
29
,
clientCache
->
renderIdCache
);
cachedRenderExtension
->
data
.
create_set
.
set_id
=
renderExtension
->
data
.
create_set
.
set_id
;
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded update. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
create_set
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_ENCODE_UPDATE
MESSAGE_BEGIN_DECODE_UPDATE
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
decodeBuffer
.
decodeDiffCachedValue
(
renderExtension
->
data
.
create_set
.
set_id
,
clientCache
->
renderLastId
,
29
,
clientCache
->
renderIdCache
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded update. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
create_set
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_DECODE_UPDATE
nxcomp/RenderCreateGlyphSetCompat.h
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef RenderCreateGlyphSetCompat_H
#define RenderCreateGlyphSetCompat_H
//
// Define the characteristics
// of this message class here.
//
#undef MESSAGE_NAME
#define MESSAGE_NAME "RenderCreateGlyphSetCompat"
#undef MESSAGE_STORE
#define MESSAGE_STORE RenderCreateGlyphSetCompatStore
#undef MESSAGE_CLASS
#define MESSAGE_CLASS RenderMinorExtensionStore
#undef MESSAGE_METHODS
#define MESSAGE_METHODS "RenderMinorExtensionMethods.h"
#undef MESSAGE_HEADERS
#define MESSAGE_HEADERS "RenderMinorExtensionHeaders.h"
#undef MESSAGE_TAGS
#define MESSAGE_TAGS "RenderMinorExtensionTags.h"
#undef MESSAGE_OFFSET
#define MESSAGE_OFFSET 8
#undef MESSAGE_HAS_SIZE
#define MESSAGE_HAS_SIZE 1
#undef MESSAGE_HAS_DATA
#define MESSAGE_HAS_DATA 1
#undef MESSAGE_HAS_FILTER
#define MESSAGE_HAS_FILTER 0
//
// Declare the message class.
//
#include MESSAGE_HEADERS
class
MESSAGE_STORE
:
public
MESSAGE_CLASS
{
public
:
virtual
const
char
*
name
()
const
{
return
MESSAGE_NAME
;
}
virtual
int
identitySize
(
const
unsigned
char
*
buffer
,
unsigned
int
size
)
{
return
MESSAGE_OFFSET
;
}
#include MESSAGE_METHODS
};
#endif
/* RenderCreateGlyphSetCompat_H */
nxcomp/RenderCreatePictureCompat.cpp
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
//
// Include the template for
// this message class.
//
#include "RenderCreatePictureCompat.h"
//
// Set the verbosity level.
//
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
#include MESSAGE_TAGS
//
// Message handling methods.
//
MESSAGE_BEGIN_ENCODE_SIZE
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
encodeBuffer
.
encodeCachedValue
((
size
-
MESSAGE_OFFSET
)
>>
2
,
16
,
clientCache
->
renderLengthCache
,
5
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded size with value "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_ENCODE_SIZE
MESSAGE_BEGIN_DECODE_SIZE
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
decodeBuffer
.
decodeCachedValue
(
size
,
16
,
clientCache
->
renderLengthCache
,
5
);
size
=
MESSAGE_OFFSET
+
(
size
<<
2
);
buffer
=
writeBuffer
->
addMessage
(
size
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded size with value "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_DECODE_SIZE
MESSAGE_BEGIN_ENCODE_MESSAGE
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
encodeBuffer
.
encodeDiffCachedValue
(
GetULONG
(
buffer
+
4
,
bigEndian
),
clientCache
->
renderLastId
,
29
,
clientCache
->
renderIdCache
);
encodeBuffer
.
encodeXidValue
(
GetULONG
(
buffer
+
8
,
bigEndian
),
clientCache
->
drawableCache
);
encodeBuffer
.
encodeCachedValue
(
GetULONG
(
buffer
+
12
,
bigEndian
),
32
,
clientCache
->
renderFormatCache
);
encodeBuffer
.
encodeCachedValue
(
GetULONG
(
buffer
+
16
,
bigEndian
),
32
,
clientCache
->
renderValueMaskCache
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded message. Type is "
<<
(
unsigned
int
)
*
(
buffer
+
1
)
<<
" size is "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_ENCODE_MESSAGE
MESSAGE_BEGIN_DECODE_MESSAGE
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
unsigned
int
value
;
*
(
buffer
+
1
)
=
type
;
decodeBuffer
.
decodeDiffCachedValue
(
value
,
clientCache
->
renderLastId
,
29
,
clientCache
->
renderIdCache
);
PutULONG
(
value
,
buffer
+
4
,
bigEndian
);
decodeBuffer
.
decodeXidValue
(
value
,
clientCache
->
drawableCache
);
PutULONG
(
value
,
buffer
+
8
,
bigEndian
);
decodeBuffer
.
decodeCachedValue
(
value
,
32
,
clientCache
->
renderFormatCache
);
PutULONG
(
value
,
buffer
+
12
,
bigEndian
);
decodeBuffer
.
decodeCachedValue
(
value
,
32
,
clientCache
->
renderValueMaskCache
);
PutULONG
(
value
,
buffer
+
16
,
bigEndian
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded message. Type is "
<<
(
unsigned
int
)
type
<<
" size is "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_DECODE_MESSAGE
MESSAGE_BEGIN_ENCODE_DATA
{
encodeLongData
(
encodeBuffer
,
buffer
,
MESSAGE_OFFSET
,
size
,
bigEndian
,
channelCache
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded "
<<
size
-
MESSAGE_OFFSET
<<
" bytes of data.
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_ENCODE_DATA
MESSAGE_BEGIN_DECODE_DATA
{
decodeLongData
(
decodeBuffer
,
buffer
,
MESSAGE_OFFSET
,
size
,
bigEndian
,
channelCache
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded "
<<
size
-
MESSAGE_OFFSET
<<
" bytes of data.
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_DECODE_DATA
MESSAGE_BEGIN_PARSE_IDENTITY
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
renderExtension
->
data
.
create_picture
.
type
=
*
(
buffer
+
1
);
renderExtension
->
data
.
create_picture
.
src_id
=
GetULONG
(
buffer
+
4
,
bigEndian
);
renderExtension
->
data
.
create_picture
.
dst_id
=
GetULONG
(
buffer
+
8
,
bigEndian
);
renderExtension
->
data
.
create_picture
.
format
=
GetULONG
(
buffer
+
12
,
bigEndian
);
renderExtension
->
data
.
create_picture
.
mask
=
GetULONG
(
buffer
+
16
,
bigEndian
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Parsed identity. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
create_picture
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_PARSE_IDENTITY
MESSAGE_BEGIN_UNPARSE_IDENTITY
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
*
(
buffer
+
1
)
=
renderExtension
->
data
.
create_picture
.
type
;
PutULONG
(
renderExtension
->
data
.
create_picture
.
src_id
,
buffer
+
4
,
bigEndian
);
PutULONG
(
renderExtension
->
data
.
create_picture
.
dst_id
,
buffer
+
8
,
bigEndian
);
PutULONG
(
renderExtension
->
data
.
create_picture
.
format
,
buffer
+
12
,
bigEndian
);
PutULONG
(
renderExtension
->
data
.
create_picture
.
mask
,
buffer
+
16
,
bigEndian
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Unparsed identity. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
create_picture
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_UNPARSE_IDENTITY
MESSAGE_BEGIN_IDENTITY_CHECKSUM
{
md5_append
(
md5_state
,
buffer
+
1
,
3
);
md5_append
(
md5_state
,
buffer
+
12
,
8
);
}
MESSAGE_END_IDENTITY_CHECKSUM
MESSAGE_BEGIN_ENCODE_UPDATE
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
RenderExtensionMessage
*
cachedRenderExtension
=
(
RenderExtensionMessage
*
)
cachedMessage
;
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Encoding new id value "
<<
renderExtension
->
data
.
create_picture
.
src_id
-
clientCache
->
renderLastId
<<
".
\n
"
;
#endif
encodeBuffer
.
encodeDiffCachedValue
(
renderExtension
->
data
.
create_picture
.
src_id
,
clientCache
->
renderLastId
,
29
,
clientCache
->
renderIdCache
);
cachedRenderExtension
->
data
.
create_picture
.
src_id
=
renderExtension
->
data
.
create_picture
.
src_id
;
encodeBuffer
.
encodeXidValue
(
renderExtension
->
data
.
create_picture
.
dst_id
,
clientCache
->
drawableCache
);
cachedRenderExtension
->
data
.
create_picture
.
dst_id
=
renderExtension
->
data
.
create_picture
.
dst_id
;
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded update. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
create_picture
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_ENCODE_UPDATE
MESSAGE_BEGIN_DECODE_UPDATE
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
decodeBuffer
.
decodeDiffCachedValue
(
renderExtension
->
data
.
create_picture
.
src_id
,
clientCache
->
renderLastId
,
29
,
clientCache
->
renderIdCache
);
decodeBuffer
.
decodeXidValue
(
renderExtension
->
data
.
create_picture
.
dst_id
,
clientCache
->
drawableCache
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded update. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
create_picture
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_DECODE_UPDATE
nxcomp/RenderCreatePictureCompat.h
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef RenderCreatePictureCompat_H
#define RenderCreatePictureCompat_H
//
// Define the characteristics
// of this message class here.
//
#undef MESSAGE_NAME
#define MESSAGE_NAME "RenderCreatePictureCompat"
#undef MESSAGE_STORE
#define MESSAGE_STORE RenderCreatePictureCompatStore
#undef MESSAGE_CLASS
#define MESSAGE_CLASS RenderMinorExtensionStore
#undef MESSAGE_METHODS
#define MESSAGE_METHODS "RenderMinorExtensionMethods.h"
#undef MESSAGE_HEADERS
#define MESSAGE_HEADERS "RenderMinorExtensionHeaders.h"
#undef MESSAGE_TAGS
#define MESSAGE_TAGS "RenderMinorExtensionTags.h"
#undef MESSAGE_OFFSET
#define MESSAGE_OFFSET 20
#undef MESSAGE_HAS_SIZE
#define MESSAGE_HAS_SIZE 1
#undef MESSAGE_HAS_DATA
#define MESSAGE_HAS_DATA 1
#undef MESSAGE_HAS_FILTER
#define MESSAGE_HAS_FILTER 0
//
// Declare the message class.
//
#include MESSAGE_HEADERS
class
MESSAGE_STORE
:
public
MESSAGE_CLASS
{
public
:
virtual
const
char
*
name
()
const
{
return
MESSAGE_NAME
;
}
virtual
int
identitySize
(
const
unsigned
char
*
buffer
,
unsigned
int
size
)
{
return
MESSAGE_OFFSET
;
}
#include MESSAGE_METHODS
};
#endif
/* RenderCreatePictureCompat_H */
nxcomp/RenderExtension.cpp
View file @
03b65211
...
@@ -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,46 +75,27 @@ RenderExtensionStore::RenderExtensionStore(StaticCompressor *compressor)
...
@@ -82,46 +75,27 @@ 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
();
minors_
[
X_RenderCreateGlyphSet
]
=
new
RenderCreateGlyphSetStore
();
minors_
[
X_RenderCreateGlyphSet
]
=
new
RenderCreateGlyphSetStore
();
minors_
[
X_RenderComposite
]
=
new
RenderCompositeStore
();
minors_
[
X_RenderComposite
]
=
new
RenderCompositeStore
();
minors_
[
X_RenderCompositeGlyphs8
]
=
new
RenderCompositeGlyphsStore
();
minors_
[
X_RenderCompositeGlyphs8
]
=
new
RenderCompositeGlyphsStore
();
minors_
[
X_RenderCompositeGlyphs16
]
=
new
RenderCompositeGlyphsStore
();
minors_
[
X_RenderCompositeGlyphs16
]
=
new
RenderCompositeGlyphsStore
();
minors_
[
X_RenderCompositeGlyphs32
]
=
new
RenderCompositeGlyphsStore
();
minors_
[
X_RenderCompositeGlyphs32
]
=
new
RenderCompositeGlyphsStore
();
minors_
[
X_RenderSetPictureTransform
]
=
new
RenderPictureTransformStore
();
minors_
[
X_RenderSetPictureTransform
]
=
new
RenderPictureTransformStore
();
minors_
[
X_RenderSetPictureFilter
]
=
new
RenderPictureFilterStore
();
minors_
[
X_RenderSetPictureFilter
]
=
new
RenderPictureFilterStore
();
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
*
logofs
<<
name
()
<<
": Encoded "
<<
size
-
offset
<<
" bytes of long data.
\n
"
<<
logofs_flush
;
#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
;
#ifdef TEST
}
*
logofs
<<
name
()
<<
": Encoded "
<<
size
-
offset
<<
" bytes of long data.
\n
"
<<
logofs_flush
;
#endif
}
}
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
*
logofs
<<
name
()
<<
": Encoded "
<<
size
-
offset
<<
" bytes of int data.
\n
"
<<
logofs_flush
;
#endif
return
;
#ifdef TEST
}
*
logofs
<<
name
()
<<
": Encoded "
<<
size
-
offset
<<
" bytes of int data.
\n
"
<<
logofs_flush
;
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
#endif
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
*
logofs
<<
name
()
<<
": Encoded "
<<
size
-
offset
<<
" bytes of text data.
\n
"
<<
logofs_flush
;
#endif
return
;
}
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
clientCache
->
renderTextCompressor
.
reset
();
const
unsigned
char
*
next
=
buffer
+
offset
;
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded "
<<
size
-
offset
for
(
unsigned
int
i
=
offset
;
i
<
size
;
i
++
)
<<
" bytes of text data.
\n
"
<<
logofs_flush
;
{
#endif
#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
*
logofs
<<
name
()
<<
": Decoded "
<<
size
-
offset
<<
" bytes of long data.
\n
"
<<
logofs_flush
;
#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
,
#ifdef TEST
*
clientCache
->
renderDataCache
[
c
]);
*
logofs
<<
name
()
<<
": Decoded "
<<
size
-
offset
<<
" bytes of long data.
\n
"
<<
logofs_flush
;
PutULONG
(
value
,
buffer
+
i
,
bigEndian
);
#endif
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
*
logofs
<<
name
()
<<
": Decoded "
<<
size
-
offset
<<
" bytes of int data.
\n
"
<<
logofs_flush
;
#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
,
#ifdef TEST
*
clientCache
->
renderDataCache
[
c
]);
*
logofs
<<
name
()
<<
": Decoded "
<<
size
-
offset
<<
" bytes of int data.
\n
"
<<
logofs_flush
;
PutUINT
(
value
,
buffer
+
i
,
bigEndian
);
#endif
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
,
...
...
nxcomp/RenderExtension.h
View file @
03b65211
...
@@ -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
...
@@ -83,13 +82,6 @@ class RenderExtensionMessage : public Message
...
@@ -83,13 +82,6 @@ class RenderExtensionMessage : public Message
friend
class
RenderTrapezoidsStore
;
friend
class
RenderTrapezoidsStore
;
friend
class
RenderTrianglesStore
;
friend
class
RenderTrianglesStore
;
friend
class
RenderCreatePictureCompatStore
;
friend
class
RenderFreePictureCompatStore
;
friend
class
RenderPictureClipCompatStore
;
friend
class
RenderCreateGlyphSetCompatStore
;
friend
class
RenderCompositeCompatStore
;
friend
class
RenderCompositeGlyphsCompatStore
;
public
:
public
:
RenderExtensionMessage
()
RenderExtensionMessage
()
...
...
nxcomp/RenderFreePictureCompat.cpp
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
//
// Include the template for
// this message class.
//
#include "RenderFreePictureCompat.h"
//
// Set the verbosity level.
//
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
#include MESSAGE_TAGS
//
// Message handling methods.
//
MESSAGE_BEGIN_ENCODE_MESSAGE
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
encodeBuffer
.
encodeDiffCachedValue
(
GetULONG
(
buffer
+
4
,
bigEndian
),
clientCache
->
renderLastId
,
29
,
clientCache
->
renderIdCache
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded message. Type is "
<<
(
unsigned
int
)
*
(
buffer
+
1
)
<<
" size is "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_ENCODE_MESSAGE
MESSAGE_BEGIN_DECODE_MESSAGE
{
unsigned
int
value
;
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
*
(
buffer
+
1
)
=
type
;
decodeBuffer
.
decodeDiffCachedValue
(
value
,
clientCache
->
renderLastId
,
29
,
clientCache
->
renderIdCache
);
PutULONG
(
value
,
buffer
+
4
,
bigEndian
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded message. Type is "
<<
(
unsigned
int
)
type
<<
" size is "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_DECODE_MESSAGE
MESSAGE_BEGIN_PARSE_IDENTITY
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
renderExtension
->
data
.
free_picture
.
type
=
*
(
buffer
+
1
);
renderExtension
->
data
.
free_picture
.
src_id
=
GetULONG
(
buffer
+
4
,
bigEndian
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Parsed identity. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
free_picture
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_PARSE_IDENTITY
MESSAGE_BEGIN_UNPARSE_IDENTITY
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
*
(
buffer
+
1
)
=
renderExtension
->
data
.
free_picture
.
type
;
PutULONG
(
renderExtension
->
data
.
free_picture
.
src_id
,
buffer
+
4
,
bigEndian
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Unparsed identity. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
free_picture
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_UNPARSE_IDENTITY
MESSAGE_BEGIN_IDENTITY_CHECKSUM
{
md5_append
(
md5_state
,
buffer
+
1
,
3
);
}
MESSAGE_END_IDENTITY_CHECKSUM
MESSAGE_BEGIN_ENCODE_UPDATE
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
RenderExtensionMessage
*
cachedRenderExtension
=
(
RenderExtensionMessage
*
)
cachedMessage
;
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
encodeBuffer
.
encodeDiffCachedValue
(
renderExtension
->
data
.
free_picture
.
src_id
,
clientCache
->
renderLastId
,
29
,
clientCache
->
renderIdCache
);
cachedRenderExtension
->
data
.
free_picture
.
src_id
=
renderExtension
->
data
.
free_picture
.
src_id
;
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded update. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
free_picture
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_ENCODE_UPDATE
MESSAGE_BEGIN_DECODE_UPDATE
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
decodeBuffer
.
decodeDiffCachedValue
(
renderExtension
->
data
.
free_picture
.
src_id
,
clientCache
->
renderLastId
,
29
,
clientCache
->
renderIdCache
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded update. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
free_picture
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_DECODE_UPDATE
nxcomp/RenderFreePictureCompat.h
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef RenderFreePictureCompat_H
#define RenderFreePictureCompat_H
//
// Define the characteristics
// of this message class here.
//
#undef MESSAGE_NAME
#define MESSAGE_NAME "RenderFreePictureCompat"
#undef MESSAGE_STORE
#define MESSAGE_STORE RenderFreePictureCompatStore
#undef MESSAGE_CLASS
#define MESSAGE_CLASS RenderMinorExtensionStore
#undef MESSAGE_METHODS
#define MESSAGE_METHODS "RenderMinorExtensionMethods.h"
#undef MESSAGE_HEADERS
#define MESSAGE_HEADERS "RenderMinorExtensionHeaders.h"
#undef MESSAGE_TAGS
#define MESSAGE_TAGS "RenderMinorExtensionTags.h"
#undef MESSAGE_OFFSET
#define MESSAGE_OFFSET 8
#undef MESSAGE_HAS_SIZE
#define MESSAGE_HAS_SIZE 0
#undef MESSAGE_HAS_DATA
#define MESSAGE_HAS_DATA 0
#undef MESSAGE_HAS_FILTER
#define MESSAGE_HAS_FILTER 0
//
// Declare the message class.
//
#include MESSAGE_HEADERS
class
MESSAGE_STORE
:
public
MESSAGE_CLASS
{
public
:
virtual
const
char
*
name
()
const
{
return
MESSAGE_NAME
;
}
virtual
int
identitySize
(
const
unsigned
char
*
buffer
,
unsigned
int
size
)
{
return
MESSAGE_OFFSET
;
}
#include MESSAGE_METHODS
};
#endif
/* RenderFreePictureCompat_H */
nxcomp/RenderPictureClipCompat.cpp
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
//
// Include the template for
// this message class.
//
#include "RenderPictureClipCompat.h"
//
// Set the verbosity level.
//
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
#include MESSAGE_TAGS
//
// Message handling methods.
//
MESSAGE_BEGIN_ENCODE_SIZE
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
encodeBuffer
.
encodeCachedValue
((
size
-
MESSAGE_OFFSET
)
>>
2
,
16
,
clientCache
->
renderLengthCache
,
5
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded size with value "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_ENCODE_SIZE
MESSAGE_BEGIN_DECODE_SIZE
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
decodeBuffer
.
decodeCachedValue
(
size
,
16
,
clientCache
->
renderLengthCache
,
5
);
size
=
MESSAGE_OFFSET
+
(
size
<<
2
);
buffer
=
writeBuffer
->
addMessage
(
size
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded size with value "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_DECODE_SIZE
MESSAGE_BEGIN_ENCODE_MESSAGE
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
encodeBuffer
.
encodeXidValue
(
GetULONG
(
buffer
+
4
,
bigEndian
),
clientCache
->
renderSrcPictureCache
);
encodeBuffer
.
encodeDiffCachedValue
(
GetUINT
(
buffer
+
8
,
bigEndian
),
clientCache
->
renderLastX
,
16
,
clientCache
->
renderXCache
,
11
);
encodeBuffer
.
encodeDiffCachedValue
(
GetUINT
(
buffer
+
10
,
bigEndian
),
clientCache
->
renderLastY
,
16
,
clientCache
->
renderYCache
,
11
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded message. Type is "
<<
(
unsigned
int
)
*
(
buffer
+
1
)
<<
" size is "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_ENCODE_MESSAGE
MESSAGE_BEGIN_DECODE_MESSAGE
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
unsigned
int
value
;
*
(
buffer
+
1
)
=
type
;
decodeBuffer
.
decodeXidValue
(
value
,
clientCache
->
renderSrcPictureCache
);
PutULONG
(
value
,
buffer
+
4
,
bigEndian
);
decodeBuffer
.
decodeDiffCachedValue
(
value
,
clientCache
->
renderLastX
,
16
,
clientCache
->
renderXCache
,
11
);
PutUINT
(
clientCache
->
renderLastX
,
buffer
+
8
,
bigEndian
);
decodeBuffer
.
decodeDiffCachedValue
(
value
,
clientCache
->
renderLastY
,
16
,
clientCache
->
renderYCache
,
11
);
PutUINT
(
clientCache
->
renderLastY
,
buffer
+
10
,
bigEndian
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded message. Type is "
<<
(
unsigned
int
)
type
<<
" size is "
<<
size
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_DECODE_MESSAGE
MESSAGE_BEGIN_ENCODE_DATA
{
encodeIntData
(
encodeBuffer
,
buffer
,
MESSAGE_OFFSET
,
size
,
bigEndian
,
channelCache
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded "
<<
size
-
MESSAGE_OFFSET
<<
" bytes of data.
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_ENCODE_DATA
MESSAGE_BEGIN_DECODE_DATA
{
decodeIntData
(
decodeBuffer
,
buffer
,
MESSAGE_OFFSET
,
size
,
bigEndian
,
channelCache
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded "
<<
size
-
MESSAGE_OFFSET
<<
" bytes of data.
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_DECODE_DATA
MESSAGE_BEGIN_PARSE_IDENTITY
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
renderExtension
->
data
.
picture_clip
.
type
=
*
(
buffer
+
1
);
renderExtension
->
data
.
picture_clip
.
src_id
=
GetULONG
(
buffer
+
4
,
bigEndian
);
renderExtension
->
data
.
picture_clip
.
src_x
=
GetUINT
(
buffer
+
8
,
bigEndian
);
renderExtension
->
data
.
picture_clip
.
src_y
=
GetUINT
(
buffer
+
10
,
bigEndian
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Parsed identity. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
picture_clip
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_PARSE_IDENTITY
MESSAGE_BEGIN_UNPARSE_IDENTITY
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
*
(
buffer
+
1
)
=
renderExtension
->
data
.
picture_clip
.
type
;
PutULONG
(
renderExtension
->
data
.
picture_clip
.
src_id
,
buffer
+
4
,
bigEndian
);
PutUINT
(
renderExtension
->
data
.
picture_clip
.
src_x
,
buffer
+
8
,
bigEndian
);
PutUINT
(
renderExtension
->
data
.
picture_clip
.
src_y
,
buffer
+
10
,
bigEndian
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Unparsed identity. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
picture_clip
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_UNPARSE_IDENTITY
MESSAGE_BEGIN_IDENTITY_CHECKSUM
{
md5_append
(
md5_state
,
buffer
+
1
,
3
);
md5_append
(
md5_state
,
buffer
+
8
,
4
);
}
MESSAGE_END_IDENTITY_CHECKSUM
MESSAGE_BEGIN_ENCODE_UPDATE
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
RenderExtensionMessage
*
cachedRenderExtension
=
(
RenderExtensionMessage
*
)
cachedMessage
;
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
encodeBuffer
.
encodeXidValue
(
renderExtension
->
data
.
picture_clip
.
src_id
,
clientCache
->
renderSrcPictureCache
);
cachedRenderExtension
->
data
.
picture_clip
.
src_id
=
renderExtension
->
data
.
picture_clip
.
src_id
;
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoded update. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
picture_clip
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_ENCODE_UPDATE
MESSAGE_BEGIN_DECODE_UPDATE
{
RenderExtensionMessage
*
renderExtension
=
(
RenderExtensionMessage
*
)
message
;
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
decodeBuffer
.
decodeXidValue
(
renderExtension
->
data
.
picture_clip
.
src_id
,
clientCache
->
renderSrcPictureCache
);
#ifdef TEST
*
logofs
<<
name
()
<<
": Decoded update. Type is "
<<
(
unsigned
int
)
renderExtension
->
data
.
picture_clip
.
type
<<
" size is "
<<
renderExtension
->
size_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
MESSAGE_END_DECODE_UPDATE
nxcomp/RenderPictureClipCompat.h
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef RenderPictureClipCompat_H
#define RenderPictureClipCompat_H
//
// Define the characteristics
// of this message class here.
//
#undef MESSAGE_NAME
#define MESSAGE_NAME "RenderPictureClipCompat"
#undef MESSAGE_STORE
#define MESSAGE_STORE RenderPictureClipCompatStore
#undef MESSAGE_CLASS
#define MESSAGE_CLASS RenderMinorExtensionStore
#undef MESSAGE_METHODS
#define MESSAGE_METHODS "RenderMinorExtensionMethods.h"
#undef MESSAGE_HEADERS
#define MESSAGE_HEADERS "RenderMinorExtensionHeaders.h"
#undef MESSAGE_TAGS
#define MESSAGE_TAGS "RenderMinorExtensionTags.h"
#undef MESSAGE_OFFSET
#define MESSAGE_OFFSET 12
#undef MESSAGE_HAS_SIZE
#define MESSAGE_HAS_SIZE 1
#undef MESSAGE_HAS_DATA
#define MESSAGE_HAS_DATA 1
#undef MESSAGE_HAS_FILTER
#define MESSAGE_HAS_FILTER 0
//
// Declare the message class.
//
#include MESSAGE_HEADERS
class
MESSAGE_STORE
:
public
MESSAGE_CLASS
{
public
:
virtual
const
char
*
name
()
const
{
return
MESSAGE_NAME
;
}
virtual
int
identitySize
(
const
unsigned
char
*
buffer
,
unsigned
int
size
)
{
return
MESSAGE_OFFSET
;
}
#include MESSAGE_METHODS
};
#endif
/* RenderPictureClipCompat_H */
nxcomp/ServerCache.cpp
View file @
03b65211
...
@@ -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
;
...
...
nxcomp/ServerCache.h
View file @
03b65211
...
@@ -23,7 +23,6 @@
...
@@ -23,7 +23,6 @@
#include "IntCache.h"
#include "IntCache.h"
#include "CharCache.h"
#include "CharCache.h"
#include "OpcodeCache.h"
#include "OpcodeCache.h"
#include "TextCompressor.h"
#include "BlockCache.h"
#include "BlockCache.h"
#include "BlockCacheSet.h"
#include "BlockCacheSet.h"
...
@@ -47,7 +46,6 @@ class ServerCache : public ChannelCache
...
@@ -47,7 +46,6 @@ class ServerCache : public ChannelCache
// General-purpose caches.
// General-purpose caches.
//
//
CharCache
textCache
[
SERVER_TEXT_CACHE_SIZE
];
IntCache
replySequenceCache
;
IntCache
replySequenceCache
;
IntCache
eventSequenceCache
;
IntCache
eventSequenceCache
;
unsigned
int
lastTimestamp
;
unsigned
int
lastTimestamp
;
...
@@ -215,7 +213,6 @@ class ServerCache : public ChannelCache
...
@@ -215,7 +213,6 @@ class ServerCache : public ChannelCache
CharCache
getPropertyFormatCache
;
CharCache
getPropertyFormatCache
;
IntCache
getPropertyTypeCache
;
IntCache
getPropertyTypeCache
;
TextCompressor
getPropertyTextCompressor
;
static
BlockCache
xResources
;
static
BlockCache
xResources
;
//
//
...
@@ -273,13 +270,6 @@ class ServerCache : public ChannelCache
...
@@ -273,13 +270,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.
//
//
...
...
nxcomp/ServerChannel.cpp
View file @
03b65211
...
@@ -199,8 +199,6 @@ ServerChannel::ServerChannel(Transport *transport, StaticCompressor *compressor)
...
@@ -199,8 +199,6 @@ ServerChannel::ServerChannel(Transport *transport, StaticCompressor *compressor)
splitState_
.
load
=
1
;
splitState_
.
load
=
1
;
splitState_
.
commit
=
0
;
splitState_
.
commit
=
0
;
handleSplitEnable
();
//
//
// It will be eventually set by
// It will be eventually set by
// the server proxy.
// the server proxy.
...
@@ -394,19 +392,6 @@ int ServerChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
...
@@ -394,19 +392,6 @@ int ServerChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
priority_
++
;
priority_
++
;
//
// Due to the way the loop was implemented
// we can't encode multiple messages if we
// are encoding the first request.
//
if
(
control
->
isProtoStep7
()
==
0
)
{
if
(
proxy
->
handleAsyncInit
()
<
0
)
{
return
-
1
;
}
}
}
}
else
else
{
{
...
@@ -545,19 +530,8 @@ int ServerChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
...
@@ -545,19 +530,8 @@ int ServerChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
encodeBuffer
.
encodeValue
(
nameLength
,
16
,
6
);
encodeBuffer
.
encodeValue
(
nameLength
,
16
,
6
);
const
unsigned
char
*
nextSrc
=
inputMessage
+
32
;
const
unsigned
char
*
nextSrc
=
inputMessage
+
32
;
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
encodeBuffer
.
encodeTextData
(
nextSrc
,
nameLength
);
encodeBuffer
.
encodeTextData
(
nextSrc
,
nameLength
);
}
else
{
serverCache_
->
getAtomNameTextCompressor
.
reset
();
for
(
unsigned
int
i
=
0
;
i
<
nameLength
;
i
++
)
{
serverCache_
->
getAtomNameTextCompressor
.
encodeChar
(
*
nextSrc
++
,
encodeBuffer
);
}
}
priority_
++
;
priority_
++
;
}
}
...
@@ -930,21 +904,10 @@ int ServerChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
...
@@ -930,21 +904,10 @@ int ServerChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
unsigned
int
length
=
(
unsigned
int
)
(
*
nextSrc
++
);
unsigned
int
length
=
(
unsigned
int
)
(
*
nextSrc
++
);
encodeBuffer
.
encodeValue
(
length
,
8
);
encodeBuffer
.
encodeValue
(
length
,
8
);
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
encodeBuffer
.
encodeTextData
(
nextSrc
,
length
);
encodeBuffer
.
encodeTextData
(
nextSrc
,
length
);
nextSrc
+=
length
;
nextSrc
+=
length
;
}
else
{
serverCache_
->
getPropertyTextCompressor
.
reset
();
for
(;
length
;
length
--
)
{
serverCache_
->
getPropertyTextCompressor
.
encodeChar
(
*
nextSrc
++
,
encodeBuffer
);
}
}
}
}
priority_
++
;
priority_
++
;
...
@@ -1253,33 +1216,9 @@ int ServerChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
...
@@ -1253,33 +1216,9 @@ int ServerChannel::handleRead(EncodeBuffer &encodeBuffer, const unsigned char *m
encodeBuffer
.
encodeCachedValue
(
GetULONG
(
inputMessage
+
8
,
bigEndian_
),
29
,
encodeBuffer
.
encodeCachedValue
(
GetULONG
(
inputMessage
+
8
,
bigEndian_
),
29
,
serverCache_
->
visualCache
);
serverCache_
->
visualCache
);
if
(
control
->
isProtoStep8
()
==
0
)
// Since ProtoStep8 (#issue 108)
{
handleCopy
(
encodeBuffer
,
requestOpcode
,
messageStore
->
unsigned
int
compressedDataSize
=
0
;
dataOffset
,
inputMessage
,
inputLength
);
unsigned
char
*
compressedData
=
NULL
;
int
compressed
=
handleCompress
(
encodeBuffer
,
requestOpcode
,
messageStore
->
dataOffset
,
inputMessage
,
inputLength
,
compressedData
,
compressedDataSize
);
if
(
compressed
<
0
)
{
return
-
1
;
}
else
if
(
compressed
>
0
)
{
//
// Update size according to result of image compression.
//
handleUpdate
(
messageStore
,
inputLength
-
messageStore
->
dataOffset
,
compressedDataSize
);
}
}
else
{
handleCopy
(
encodeBuffer
,
requestOpcode
,
messageStore
->
dataOffset
,
inputMessage
,
inputLength
);
}
priority_
++
;
priority_
++
;
}
}
...
@@ -2069,10 +2008,8 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
...
@@ -2069,10 +2008,8 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
// encoding is used.
// encoding is used.
//
//
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
decodeBuffer
.
decodeValue
(
length
,
8
);
decodeBuffer
.
decodeValue
(
length
,
8
);
}
unsigned
int
nextByte
;
unsigned
int
nextByte
;
unsigned
char
*
outputMessage
=
writeBuffer_
.
addMessage
(
length
);
unsigned
char
*
outputMessage
=
writeBuffer_
.
addMessage
(
length
);
...
@@ -2285,19 +2222,8 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
...
@@ -2285,19 +2222,8 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
if
(
format
==
8
)
if
(
format
==
8
)
{
{
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
decodeBuffer
.
decodeTextData
(
nextDest
,
dataLength
);
decodeBuffer
.
decodeTextData
(
nextDest
,
dataLength
);
}
else
{
clientCache_
->
changePropertyTextCompressor
.
reset
();
for
(
unsigned
int
i
=
0
;
i
<
dataLength
;
i
++
)
{
*
nextDest
++
=
clientCache_
->
changePropertyTextCompressor
.
decodeChar
(
decodeBuffer
);
}
}
}
}
else
if
(
format
==
32
)
else
if
(
format
==
32
)
{
{
...
@@ -2584,16 +2510,10 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
...
@@ -2584,16 +2510,10 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
outputMessage
=
writeBuffer_
.
addMessage
(
outputLength
);
outputMessage
=
writeBuffer_
.
addMessage
(
outputLength
);
writeBuffer_
.
registerPointer
(
&
outputMessage
);
writeBuffer_
.
registerPointer
(
&
outputMessage
);
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
);
}
else
{
decodeBuffer
.
decodeXidValue
(
value
,
clientCache_
->
gcCache
);
}
PutULONG
(
value
,
outputMessage
+
4
,
bigEndian_
);
PutULONG
(
value
,
outputMessage
+
4
,
bigEndian_
);
unsigned
int
offset
=
8
;
unsigned
int
offset
=
8
;
...
@@ -2688,16 +2608,10 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
...
@@ -2688,16 +2608,10 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
decodeBuffer
.
decodeXidValue
(
value
,
clientCache_
->
windowCache
);
decodeBuffer
.
decodeXidValue
(
value
,
clientCache_
->
windowCache
);
PutULONG
(
value
,
outputMessage
+
8
,
bigEndian_
);
PutULONG
(
value
,
outputMessage
+
8
,
bigEndian_
);
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
decodeBuffer
.
decodeNewXidValue
(
value
,
clientCache_
->
lastId
,
decodeBuffer
.
decodeNewXidValue
(
value
,
clientCache_
->
lastId
,
clientCache_
->
lastIdCache
,
clientCache_
->
windowCache
,
clientCache_
->
lastIdCache
,
clientCache_
->
windowCache
,
clientCache_
->
freeWindowCache
);
clientCache_
->
freeWindowCache
);
}
else
{
decodeBuffer
.
decodeXidValue
(
value
,
clientCache_
->
windowCache
);
}
PutULONG
(
value
,
outputMessage
+
4
,
bigEndian_
);
PutULONG
(
value
,
outputMessage
+
4
,
bigEndian_
);
unsigned
char
*
nextDest
=
outputMessage
+
12
;
unsigned
char
*
nextDest
=
outputMessage
+
12
;
...
@@ -2754,16 +2668,9 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
...
@@ -2754,16 +2668,9 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
unsigned
int
numPoints
;
unsigned
int
numPoints
;
if
(
control
->
isProtoStep10
()
==
1
)
// Since ProtoStep10 (#issue 108)
{
decodeBuffer
.
decodeCachedValue
(
numPoints
,
16
,
decodeBuffer
.
decodeCachedValue
(
numPoints
,
16
,
clientCache_
->
fillPolyNumPointsCache
,
4
);
clientCache_
->
fillPolyNumPointsCache
,
4
);
}
else
{
decodeBuffer
.
decodeCachedValue
(
numPoints
,
14
,
clientCache_
->
fillPolyNumPointsCache
,
4
);
}
outputLength
=
16
+
(
numPoints
<<
2
);
outputLength
=
16
+
(
numPoints
<<
2
);
outputMessage
=
writeBuffer_
.
addMessage
(
outputLength
);
outputMessage
=
writeBuffer_
.
addMessage
(
outputLength
);
...
@@ -2859,14 +2766,8 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
...
@@ -2859,14 +2766,8 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
outputLength
=
8
;
outputLength
=
8
;
outputMessage
=
writeBuffer_
.
addMessage
(
outputLength
);
outputMessage
=
writeBuffer_
.
addMessage
(
outputLength
);
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
decodeBuffer
.
decodeFreeXidValue
(
value
,
clientCache_
->
freeGCCache
);
decodeBuffer
.
decodeFreeXidValue
(
value
,
clientCache_
->
freeGCCache
);
}
else
{
decodeBuffer
.
decodeXidValue
(
value
,
clientCache_
->
gcCache
);
}
PutULONG
(
value
,
outputMessage
+
4
,
bigEndian_
);
PutULONG
(
value
,
outputMessage
+
4
,
bigEndian_
);
}
}
...
@@ -2876,23 +2777,10 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
...
@@ -2876,23 +2777,10 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
outputLength
=
8
;
outputLength
=
8
;
outputMessage
=
writeBuffer_
.
addMessage
(
outputLength
);
outputMessage
=
writeBuffer_
.
addMessage
(
outputLength
);
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
decodeBuffer
.
decodeFreeXidValue
(
value
,
clientCache_
->
freeDrawableCache
);
decodeBuffer
.
decodeFreeXidValue
(
value
,
clientCache_
->
freeDrawableCache
);
PutULONG
(
value
,
outputMessage
+
4
,
bigEndian_
);
PutULONG
(
value
,
outputMessage
+
4
,
bigEndian_
);
}
else
{
decodeBuffer
.
decodeBoolValue
(
value
);
if
(
!
value
)
{
decodeBuffer
.
decodeValue
(
value
,
29
,
4
);
clientCache_
->
createPixmapLastId
+=
value
;
clientCache_
->
createPixmapLastId
&=
0x1fffffff
;
}
PutULONG
(
clientCache_
->
createPixmapLastId
,
outputMessage
+
4
,
bigEndian_
);
}
}
}
break
;
break
;
case
X_GetAtomName
:
case
X_GetAtomName
:
...
@@ -3125,21 +3013,10 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
...
@@ -3125,21 +3013,10 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
clientCache_
->
polyTextDeltaCache
);
clientCache_
->
polyTextDeltaCache
);
*
nextDest
++
=
cValue
;
*
nextDest
++
=
cValue
;
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
decodeBuffer
.
decodeTextData
(
nextDest
,
textLength
);
decodeBuffer
.
decodeTextData
(
nextDest
,
textLength
);
nextDest
+=
textLength
;
nextDest
+=
textLength
;
}
else
{
clientCache_
->
polyTextTextCompressor
.
reset
();
while
(
textLength
)
{
*
nextDest
++
=
clientCache_
->
polyTextTextCompressor
.
decodeChar
(
decodeBuffer
);
textLength
--
;
}
}
}
}
}
}
outputLength
+=
addedLength
;
outputLength
+=
addedLength
;
...
@@ -3211,23 +3088,10 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
...
@@ -3211,23 +3088,10 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
decodeBuffer
.
decodeCachedValue
(
cValue
,
8
,
clientCache_
->
polyTextDeltaCache
);
decodeBuffer
.
decodeCachedValue
(
cValue
,
8
,
clientCache_
->
polyTextDeltaCache
);
*
nextDest
++
=
cValue
;
*
nextDest
++
=
cValue
;
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
decodeBuffer
.
decodeTextData
(
nextDest
,
textLength
*
2
);
decodeBuffer
.
decodeTextData
(
nextDest
,
textLength
*
2
);
nextDest
+=
textLength
*
2
;
nextDest
+=
textLength
*
2
;
}
else
{
clientCache_
->
polyTextTextCompressor
.
reset
();
textLength
<<=
1
;
while
(
textLength
)
{
*
nextDest
++
=
clientCache_
->
polyTextTextCompressor
.
decodeChar
(
decodeBuffer
);
textLength
--
;
}
}
}
}
}
}
outputLength
+=
addedLength
;
outputLength
+=
addedLength
;
...
@@ -3279,16 +3143,8 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
...
@@ -3279,16 +3143,8 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
PutUINT
(
clientCache_
->
imageTextLastY
,
outputMessage
+
14
,
bigEndian_
);
PutUINT
(
clientCache_
->
imageTextLastY
,
outputMessage
+
14
,
bigEndian_
);
unsigned
char
*
nextDest
=
outputMessage
+
16
;
unsigned
char
*
nextDest
=
outputMessage
+
16
;
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
decodeBuffer
.
decodeTextData
(
nextDest
,
textLength
);
decodeBuffer
.
decodeTextData
(
nextDest
,
textLength
);
}
else
{
clientCache_
->
imageTextTextCompressor
.
reset
();
for
(
unsigned
int
j
=
0
;
j
<
textLength
;
j
++
)
*
nextDest
++
=
clientCache_
->
imageTextTextCompressor
.
decodeChar
(
decodeBuffer
);
}
handleSave
(
messageStore
,
outputMessage
,
outputLength
);
handleSave
(
messageStore
,
outputMessage
,
outputLength
);
}
}
...
@@ -3326,16 +3182,8 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
...
@@ -3326,16 +3182,8 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
PutUINT
(
clientCache_
->
imageTextLastY
,
outputMessage
+
14
,
bigEndian_
);
PutUINT
(
clientCache_
->
imageTextLastY
,
outputMessage
+
14
,
bigEndian_
);
unsigned
char
*
nextDest
=
outputMessage
+
16
;
unsigned
char
*
nextDest
=
outputMessage
+
16
;
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
decodeBuffer
.
decodeTextData
(
nextDest
,
textLength
*
2
);
decodeBuffer
.
decodeTextData
(
nextDest
,
textLength
*
2
);
}
else
{
clientCache_
->
imageTextTextCompressor
.
reset
();
for
(
unsigned
int
j
=
0
;
j
<
textLength
*
2
;
j
++
)
*
nextDest
++
=
clientCache_
->
imageTextTextCompressor
.
decodeChar
(
decodeBuffer
);
}
handleSave
(
messageStore
,
outputMessage
,
outputLength
);
handleSave
(
messageStore
,
outputMessage
,
outputLength
);
}
}
...
@@ -3362,18 +3210,8 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
...
@@ -3362,18 +3210,8 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
outputMessage
[
1
]
=
(
unsigned
char
)
value
;
outputMessage
[
1
]
=
(
unsigned
char
)
value
;
unsigned
char
*
nextDest
=
outputMessage
+
8
;
unsigned
char
*
nextDest
=
outputMessage
+
8
;
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
decodeBuffer
.
decodeTextData
(
nextDest
,
nameLength
);
decodeBuffer
.
decodeTextData
(
nextDest
,
nameLength
);
}
else
{
clientCache_
->
internAtomTextCompressor
.
reset
();
for
(
unsigned
int
i
=
0
;
i
<
nameLength
;
i
++
)
{
*
nextDest
++
=
clientCache_
->
internAtomTextCompressor
.
decodeChar
(
decodeBuffer
);
}
}
sequenceQueue_
.
push
(
clientSequence_
,
outputOpcode
);
sequenceQueue_
.
push
(
clientSequence_
,
outputOpcode
);
...
@@ -3399,18 +3237,8 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
...
@@ -3399,18 +3237,8 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
PutUINT
(
value
,
outputMessage
+
4
,
bigEndian_
);
PutUINT
(
value
,
outputMessage
+
4
,
bigEndian_
);
unsigned
char
*
nextDest
=
outputMessage
+
8
;
unsigned
char
*
nextDest
=
outputMessage
+
8
;
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
decodeBuffer
.
decodeTextData
(
nextDest
,
textLength
);
decodeBuffer
.
decodeTextData
(
nextDest
,
textLength
);
}
else
{
clientCache_
->
polyTextTextCompressor
.
reset
();
for
(
unsigned
int
i
=
0
;
i
<
textLength
;
i
++
)
{
*
nextDest
++
=
clientCache_
->
polyTextTextCompressor
.
decodeChar
(
decodeBuffer
);
}
}
sequenceQueue_
.
push
(
clientSequence_
,
outputOpcode
);
sequenceQueue_
.
push
(
clientSequence_
,
outputOpcode
);
}
}
...
@@ -3428,18 +3256,8 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
...
@@ -3428,18 +3256,8 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
PutUINT
(
textLength
,
outputMessage
+
8
,
bigEndian_
);
PutUINT
(
textLength
,
outputMessage
+
8
,
bigEndian_
);
unsigned
char
*
nextDest
=
outputMessage
+
12
;
unsigned
char
*
nextDest
=
outputMessage
+
12
;
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
decodeBuffer
.
decodeTextData
(
nextDest
,
textLength
);
decodeBuffer
.
decodeTextData
(
nextDest
,
textLength
);
}
else
{
clientCache_
->
polyTextTextCompressor
.
reset
();
for
(
unsigned
int
i
=
0
;
i
<
textLength
;
i
++
)
{
*
nextDest
++
=
clientCache_
->
polyTextTextCompressor
.
decodeChar
(
decodeBuffer
);
}
}
sequenceQueue_
.
push
(
clientSequence_
,
outputOpcode
);
sequenceQueue_
.
push
(
clientSequence_
,
outputOpcode
);
}
}
...
@@ -3456,7 +3274,7 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
...
@@ -3456,7 +3274,7 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
outputLength
=
8
;
outputLength
=
8
;
outputMessage
=
writeBuffer_
.
addMessage
(
outputLength
);
outputMessage
=
writeBuffer_
.
addMessage
(
outputLength
);
if
(
outputOpcode
==
X_DestroyWindow
&&
control
->
isProtoStep7
()
==
1
)
if
(
outputOpcode
==
X_DestroyWindow
)
// Since ProtoStep7 (#issue 108
)
{
{
decodeBuffer
.
decodeFreeXidValue
(
value
,
clientCache_
->
freeWindowCache
);
decodeBuffer
.
decodeFreeXidValue
(
value
,
clientCache_
->
freeWindowCache
);
}
}
...
@@ -3487,19 +3305,8 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
...
@@ -3487,19 +3305,8 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
PutULONG
(
clientCache_
->
lastFont
,
outputMessage
+
4
,
bigEndian_
);
PutULONG
(
clientCache_
->
lastFont
,
outputMessage
+
4
,
bigEndian_
);
unsigned
char
*
nextDest
=
outputMessage
+
12
;
unsigned
char
*
nextDest
=
outputMessage
+
12
;
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
decodeBuffer
.
decodeTextData
(
nextDest
,
nameLength
);
decodeBuffer
.
decodeTextData
(
nextDest
,
nameLength
);
}
else
{
clientCache_
->
openFontTextCompressor
.
reset
();
for
(;
nameLength
;
nameLength
--
)
{
*
nextDest
++
=
clientCache_
->
openFontTextCompressor
.
decodeChar
(
decodeBuffer
);
}
}
}
}
break
;
break
;
case
X_PolyFillRectangle
:
case
X_PolyFillRectangle
:
...
@@ -4137,14 +3944,8 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
...
@@ -4137,14 +3944,8 @@ int ServerChannel::handleWrite(const unsigned char *message, unsigned int length
unsigned
int
numRectangles
;
unsigned
int
numRectangles
;
if
(
control
->
isProtoStep9
()
==
1
)
// Since ProtoStep9 (#issue 108)
{
decodeBuffer
.
decodeValue
(
numRectangles
,
15
,
4
);
decodeBuffer
.
decodeValue
(
numRectangles
,
15
,
4
);
}
else
{
decodeBuffer
.
decodeValue
(
numRectangles
,
13
,
4
);
}
outputLength
=
(
numRectangles
<<
3
)
+
12
;
outputLength
=
(
numRectangles
<<
3
)
+
12
;
outputMessage
=
writeBuffer_
.
addMessage
(
outputLength
);
outputMessage
=
writeBuffer_
.
addMessage
(
outputLength
);
...
@@ -4669,10 +4470,8 @@ int ServerChannel::handleSplit(DecodeBuffer &decodeBuffer, MessageStore *store,
...
@@ -4669,10 +4470,8 @@ int ServerChannel::handleSplit(DecodeBuffer &decodeBuffer, MessageStore *store,
T_store_action
action
,
int
position
,
unsigned
char
&
opcode
,
T_store_action
action
,
int
position
,
unsigned
char
&
opcode
,
unsigned
char
*&
buffer
,
unsigned
int
&
size
)
unsigned
char
*&
buffer
,
unsigned
int
&
size
)
{
{
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
splitState_
.
current
=
splitState_
.
resource
;
splitState_
.
current
=
splitState_
.
resource
;
}
handleSplitStoreAlloc
(
&
splitResources_
,
splitState_
.
current
);
handleSplitStoreAlloc
(
&
splitResources_
,
splitState_
.
current
);
...
@@ -4707,14 +4506,12 @@ int ServerChannel::handleSplit(DecodeBuffer &decodeBuffer, MessageStore *store,
...
@@ -4707,14 +4506,12 @@ int ServerChannel::handleSplit(DecodeBuffer &decodeBuffer, MessageStore *store,
action
,
checksum
,
buffer
,
size
);
action
,
checksum
,
buffer
,
size
);
//
//
// If we are connected to an old proxy
// If the encoding side didn't provide
// version or the encoding side didn't
// a checksum, then don't send the split
// provide a checksum, then don't send
// report.
// the split report.
//
//
if
(
control
->
isProtoStep7
()
==
0
||
if
(
checksum
==
NULL
)
checksum
==
NULL
)
{
{
if
(
action
==
IS_HIT
)
if
(
action
==
IS_HIT
)
{
{
...
@@ -4736,8 +4533,6 @@ int ServerChannel::handleSplit(DecodeBuffer &decodeBuffer, MessageStore *store,
...
@@ -4736,8 +4533,6 @@ int ServerChannel::handleSplit(DecodeBuffer &decodeBuffer, MessageStore *store,
#endif
#endif
delete
[]
checksum
;
return
1
;
return
1
;
}
}
...
@@ -4829,13 +4624,11 @@ int ServerChannel::handleSplit(DecodeBuffer &decodeBuffer)
...
@@ -4829,13 +4624,11 @@ int ServerChannel::handleSplit(DecodeBuffer &decodeBuffer)
unsigned
char
resource
;
unsigned
char
resource
;
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
decodeBuffer
.
decodeCachedValue
(
resource
,
8
,
decodeBuffer
.
decodeCachedValue
(
resource
,
8
,
clientCache_
->
resourceCache
);
clientCache_
->
resourceCache
);
splitState_
.
current
=
resource
;
splitState_
.
current
=
resource
;
}
handleSplitStoreAlloc
(
&
splitResources_
,
splitState_
.
current
);
handleSplitStoreAlloc
(
&
splitResources_
,
splitState_
.
current
);
...
@@ -5391,8 +5184,11 @@ int ServerChannel::handleColormap(unsigned char &opcode, unsigned char *&buffer,
...
@@ -5391,8 +5184,11 @@ int ServerChannel::handleColormap(unsigned char &opcode, unsigned char *&buffer,
// data in compressed form.
// data in compressed form.
//
//
if
(
control
->
isProtoStep7
()
==
1
)
//
{
// Since ProtoStep7 (#issue 108)
//
{
// An anonymous block is used here to limit the scope of local variables
unsigned
int
packed
=
GetULONG
(
buffer
+
8
,
bigEndian_
);
unsigned
int
packed
=
GetULONG
(
buffer
+
8
,
bigEndian_
);
unsigned
int
unpacked
=
GetULONG
(
buffer
+
12
,
bigEndian_
);
unsigned
int
unpacked
=
GetULONG
(
buffer
+
12
,
bigEndian_
);
...
@@ -5486,85 +5282,7 @@ int ServerChannel::handleColormap(unsigned char &opcode, unsigned char *&buffer,
...
@@ -5486,85 +5282,7 @@ int ServerChannel::handleColormap(unsigned char &opcode, unsigned char *&buffer,
}
}
#endif
#endif
}
}
// end anonymous block
else
{
unsigned
int
entries
=
GetULONG
(
buffer
+
4
,
bigEndian_
);
if
(
size
==
entries
*
4
+
8
)
{
if
(
unpackState_
[
resource
]
->
colormap
->
entries
!=
entries
&&
unpackState_
[
resource
]
->
colormap
->
data
!=
NULL
)
{
#ifdef TEST
*
logofs
<<
"handleColormap: Freeing previously "
<<
"allocated unpack colormap.
\n
"
<<
logofs_flush
;
#endif
delete
[]
unpackState_
[
resource
]
->
colormap
->
data
;
unpackState_
[
resource
]
->
colormap
->
data
=
NULL
;
unpackState_
[
resource
]
->
colormap
->
entries
=
0
;
}
if
(
entries
>
0
)
{
if
(
unpackState_
[
resource
]
->
colormap
->
data
==
NULL
)
{
unpackState_
[
resource
]
->
colormap
->
data
=
new
unsigned
int
[
entries
];
}
if
(
unpackState_
[
resource
]
->
colormap
->
data
!=
NULL
)
{
unpackState_
[
resource
]
->
colormap
->
entries
=
entries
;
#ifdef DEBUG
*
logofs
<<
"handleColormap: Size of new colormap "
<<
"data is "
<<
(
entries
<<
2
)
<<
".
\n
"
<<
logofs_flush
;
#endif
memcpy
((
unsigned
char
*
)
unpackState_
[
resource
]
->
colormap
->
data
,
buffer
+
8
,
entries
<<
2
);
#if defined(DEBUG) && defined(DUMP)
*
logofs
<<
"handleColormap: Dumping colormap entries:
\n
"
<<
logofs_flush
;
const
unsigned
int
*
p
=
(
unsigned
int
*
)
buffer
+
8
;
for
(
unsigned
int
i
=
0
;
i
<
entries
;
i
++
)
{
*
logofs
<<
"handleColormap: ["
<<
i
<<
"] ["
<<
(
void
*
)
p
[
i
]
<<
"].
\n
"
<<
logofs_flush
;
}
#endif
}
else
{
#ifdef PANIC
*
logofs
<<
"handleColormap: PANIC! Can't allocate "
<<
entries
<<
" entries for unpack colormap "
<<
"for FD#"
<<
fd_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
}
}
else
{
#ifdef PANIC
*
logofs
<<
"handleColormap: PANIC! Bad size "
<<
size
<<
" for set unpack colormap message for FD#"
<<
fd_
<<
" with "
<<
entries
<<
" entries.
\n
"
<<
logofs_flush
;
#endif
}
}
handleColormapEnd
:
handleColormapEnd
:
...
@@ -5593,8 +5311,11 @@ int ServerChannel::handleAlpha(unsigned char &opcode, unsigned char *&buffer,
...
@@ -5593,8 +5311,11 @@ int ServerChannel::handleAlpha(unsigned char &opcode, unsigned char *&buffer,
// data in compressed form.
// data in compressed form.
//
//
if
(
control
->
isProtoStep7
()
==
1
)
//
{
// Since ProtoStep7 (#issue 108)
//
{
// An anonymous block is used here to limit the scope of local variables
unsigned
int
packed
=
GetULONG
(
buffer
+
8
,
bigEndian_
);
unsigned
int
packed
=
GetULONG
(
buffer
+
8
,
bigEndian_
);
unsigned
int
unpacked
=
GetULONG
(
buffer
+
12
,
bigEndian_
);
unsigned
int
unpacked
=
GetULONG
(
buffer
+
12
,
bigEndian_
);
...
@@ -5687,82 +5408,7 @@ int ServerChannel::handleAlpha(unsigned char &opcode, unsigned char *&buffer,
...
@@ -5687,82 +5408,7 @@ int ServerChannel::handleAlpha(unsigned char &opcode, unsigned char *&buffer,
}
}
#endif
#endif
}
}
//end anonymous block
else
{
unsigned
int
entries
=
GetULONG
(
buffer
+
4
,
bigEndian_
);
if
(
size
==
RoundUp4
(
entries
)
+
8
)
{
if
(
unpackState_
[
resource
]
->
alpha
->
entries
!=
entries
&&
unpackState_
[
resource
]
->
alpha
->
data
!=
NULL
)
{
#ifdef TEST
*
logofs
<<
"handleAlpha: Freeing previously allocated "
<<
"unpack alpha data.
\n
"
<<
logofs_flush
;
#endif
delete
[]
unpackState_
[
resource
]
->
alpha
->
data
;
unpackState_
[
resource
]
->
alpha
->
data
=
NULL
;
unpackState_
[
resource
]
->
alpha
->
entries
=
0
;
}
if
(
entries
>
0
)
{
if
(
unpackState_
[
resource
]
->
alpha
->
data
==
NULL
)
{
unpackState_
[
resource
]
->
alpha
->
data
=
new
unsigned
char
[
entries
];
}
if
(
unpackState_
[
resource
]
->
alpha
->
data
!=
NULL
)
{
unpackState_
[
resource
]
->
alpha
->
entries
=
entries
;
#ifdef DEBUG
*
logofs
<<
"handleAlpha: Size of new alpha data is "
<<
entries
<<
".
\n
"
<<
logofs_flush
;
#endif
memcpy
((
unsigned
char
*
)
unpackState_
[
resource
]
->
alpha
->
data
,
buffer
+
8
,
entries
);
#if defined(DEBUG) && defined(DUMP)
*
logofs
<<
"handleAlpha: Dumping alpha entries:
\n
"
<<
logofs_flush
;
const
unsigned
char
*
p
=
buffer
+
8
;
for
(
unsigned
int
i
=
0
;
i
<
entries
;
i
++
)
{
*
logofs
<<
"handleAlpha: ["
<<
i
<<
"] ["
<<
(
void
*
)
((
int
)
p
[
i
])
<<
"].
\n
"
<<
logofs_flush
;
}
#endif
}
else
{
#ifdef PANIC
*
logofs
<<
"handleAlpha: PANIC! Can't allocate "
<<
entries
<<
" entries for unpack alpha data "
<<
"for FD#"
<<
fd_
<<
".
\n
"
<<
logofs_flush
;
#endif
}
}
}
#ifdef PANIC
else
{
*
logofs
<<
"handleAlpha: PANIC! Bad size "
<<
size
<<
" for set unpack alpha message for FD#"
<<
fd_
<<
" with "
<<
entries
<<
" entries.
\n
"
<<
logofs_flush
;
}
#endif
}
handleAlphaEnd
:
handleAlphaEnd
:
...
@@ -6680,15 +6326,20 @@ int ServerChannel::handleFastWriteRequest(DecodeBuffer &decodeBuffer, unsigned c
...
@@ -6680,15 +6326,20 @@ int ServerChannel::handleFastWriteRequest(DecodeBuffer &decodeBuffer, unsigned c
{
{
//
//
// All the NX requests are handled in the
// All the NX requests are handled in the
// main message loop. The X_PutImage can
// main message loop.
// be handled here only if a split was
//
// not requested.
//
// Since ProtoStep7 (#issue 108)
//
// The X_PutImage can be handled here only
// if a split was not requested.
//
//
if
((
opcode
>=
X_NXFirstOpcode
&&
opcode
<=
X_NXLastOpcode
)
||
if
((
opcode
>=
X_NXFirstOpcode
&&
opcode
<=
X_NXLastOpcode
)
||
(
control
->
isProtoStep7
()
==
1
&&
opcode
==
X_PutImage
&&
(
opcode
==
X_PutImage
&&
splitState_
.
resource
!=
nothing
)
||
splitState_
.
resource
!=
nothing
)
||
opcode
==
X_ListExtensions
||
opcode
==
X_ListExtensions
||
opcode
==
X_QueryExtension
)
opcode
==
X_QueryExtension
)
{
{
return
0
;
return
0
;
}
}
...
@@ -7896,14 +7547,6 @@ int ServerChannel::handleCacheRequest(DecodeBuffer &decodeBuffer, unsigned char
...
@@ -7896,14 +7547,6 @@ int ServerChannel::handleCacheRequest(DecodeBuffer &decodeBuffer, unsigned char
splitState_
.
save
=
(
mask
>>
8
)
&
0xff
;
splitState_
.
save
=
(
mask
>>
8
)
&
0xff
;
splitState_
.
load
=
mask
&
0xff
;
splitState_
.
load
=
mask
&
0xff
;
//
// Just to be sure. We should never
// receive this request if connected
// to an old proxy version.
//
handleSplitEnable
();
#ifdef TEST
#ifdef TEST
*
logofs
<<
"handleCacheRequest: Set cache parameters to "
*
logofs
<<
"handleCacheRequest: Set cache parameters to "
<<
"save "
<<
splitState_
.
save
<<
" load "
<<
"save "
<<
splitState_
.
save
<<
" load "
...
@@ -7920,34 +7563,24 @@ int ServerChannel::handleStartSplitRequest(DecodeBuffer &decodeBuffer, unsigned
...
@@ -7920,34 +7563,24 @@ int ServerChannel::handleStartSplitRequest(DecodeBuffer &decodeBuffer, unsigned
{
{
//
//
// Prepare for the split for the selected
// Prepare for the split for the selected
// resource. Old proxy versions only use
// resource. Old proxy versions only use
d
// the split store at position 0.
// the split store at position 0.
//
//
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
unsigned
char
resource
;
unsigned
char
resource
;
decodeBuffer
.
decodeCachedValue
(
resource
,
8
,
decodeBuffer
.
decodeCachedValue
(
resource
,
8
,
clientCache_
->
resourceCache
);
clientCache_
->
resourceCache
);
splitState_
.
resource
=
resource
;
splitState_
.
resource
=
resource
;
splitState_
.
current
=
splitState_
.
resource
;
splitState_
.
current
=
splitState_
.
resource
;
#if defined(TEST) || defined(SPLIT)
*
logofs
<<
"handleStartSplitRequest: SPLIT! Registered id "
<<
splitState_
.
resource
<<
" as resource "
<<
"waiting for a split.
\n
"
<<
logofs_flush
;
#endif
}
#if defined(TEST) || defined(SPLIT)
#if defined(TEST) || defined(SPLIT)
else
*
logofs
<<
"handleStartSplitRequest: SPLIT! Registered id "
{
<<
splitState_
.
resource
<<
" as resource "
*
logofs
<<
"handleStartSplitRequest: SPLIT! Assuming fake id "
<<
"waiting for a split.
\n
"
<<
logofs_flush
;
<<
splitState_
.
current
<<
" as resource "
<<
"waiting for a split.
\n
"
<<
logofs_flush
;
}
#endif
#endif
handleNullRequest
(
opcode
,
buffer
,
size
);
handleNullRequest
(
opcode
,
buffer
,
size
);
...
@@ -7962,40 +7595,38 @@ int ServerChannel::handleEndSplitRequest(DecodeBuffer &decodeBuffer, unsigned ch
...
@@ -7962,40 +7595,38 @@ int ServerChannel::handleEndSplitRequest(DecodeBuffer &decodeBuffer, unsigned ch
// Verify that the agent resource matches.
// Verify that the agent resource matches.
//
//
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
unsigned
char
resource
;
unsigned
char
resource
;
decodeBuffer
.
decodeCachedValue
(
resource
,
8
,
clientCache_
->
resourceCache
);
#ifdef TEST
if
(
splitState_
.
resource
==
nothing
)
decodeBuffer
.
decodeCachedValue
(
resource
,
8
,
{
clientCache_
->
resourceCache
);
#ifdef PANIC
*
logofs
<<
"handleEndSplitRequest: PANIC! SPLIT! Received an end of "
<<
"split for resource id "
<<
(
unsigned
int
)
*
(
buffer
+
1
)
<<
" without a previous start.
\n
"
<<
logofs_flush
;
#endif
HandleCleanup
();
#ifdef TEST
}
else
if
(
resource
!=
splitState_
.
resource
)
{
#ifdef PANIC
*
logofs
<<
"handleEndSplitRequest: PANIC! SPLIT! Invalid resource id "
<<
resource
<<
" received while waiting for resource id "
<<
splitState_
.
resource
<<
".
\n
"
<<
logofs_flush
;
#endif
HandleCleanup
();
if
(
splitState_
.
resource
==
nothing
)
}
{
#ifdef PANIC
*
logofs
<<
"handleEndSplitRequest: PANIC! SPLIT! Received an end of "
<<
"split for resource id "
<<
(
unsigned
int
)
*
(
buffer
+
1
)
<<
" without a previous start.
\n
"
<<
logofs_flush
;
#endif
HandleCleanup
();
}
else
if
(
resource
!=
splitState_
.
resource
)
{
#ifdef PANIC
*
logofs
<<
"handleEndSplitRequest: PANIC! SPLIT! Invalid resource id "
<<
resource
<<
" received while waiting for resource id "
<<
splitState_
.
resource
<<
".
\n
"
<<
logofs_flush
;
#endif
#endif
HandleCleanup
();
}
}
#endif
#if defined(TEST) || defined(SPLIT)
#if defined(TEST) || defined(SPLIT)
*
logofs
<<
"handleEndSplitRequest: SPLIT! Reset id "
*
logofs
<<
"handleEndSplitRequest: SPLIT! Reset id "
<<
splitState_
.
resource
<<
" as resource "
<<
splitState_
.
resource
<<
" as resource "
...
@@ -8013,15 +7644,8 @@ int ServerChannel::handleSplitChecksum(DecodeBuffer &decodeBuffer, T_checksum &c
...
@@ -8013,15 +7644,8 @@ int ServerChannel::handleSplitChecksum(DecodeBuffer &decodeBuffer, T_checksum &c
{
{
unsigned
int
receive
;
unsigned
int
receive
;
if
(
control
->
isProtoStep7
()
==
1
)
// Since ProtoStep7 (#issue 108)
{
decodeBuffer
.
decodeBoolValue
(
receive
);
decodeBuffer
.
decodeBoolValue
(
receive
);
}
else
{
receive
=
(
control
->
ImageCacheEnableLoad
==
1
||
control
->
ImageCacheEnableSave
==
1
);
}
if
(
receive
==
1
)
if
(
receive
==
1
)
{
{
...
...
nxcomp/ServerChannel.h
View file @
03b65211
...
@@ -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.
...
...
nxcomp/ServerProxy.h
View file @
03b65211
...
@@ -102,14 +102,8 @@ class ServerProxy : public Proxy
...
@@ -102,14 +102,8 @@ 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
:
...
...
nxcomp/SetUnpackAlpha.cpp
View file @
03b65211
...
@@ -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
);
...
...
nxcomp/SetUnpackAlpha.h
View file @
03b65211
...
@@ -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
...
...
nxcomp/SetUnpackAlphaCompat.cpp
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#include "SetUnpackAlphaCompat.h"
#include "ClientCache.h"
#include "EncodeBuffer.h"
#include "DecodeBuffer.h"
#include "WriteBuffer.h"
//
// Set the verbosity level.
//
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
#undef DUMP
//
// Constructors and destructors.
//
SetUnpackAlphaCompatStore
::
SetUnpackAlphaCompatStore
(
StaticCompressor
*
compressor
)
:
MessageStore
(
compressor
)
{
enableCache
=
SETUNPACKALPHA_ENABLE_CACHE
;
enableData
=
SETUNPACKALPHA_ENABLE_DATA
;
enableSplit
=
SETUNPACKALPHA_ENABLE_SPLIT
;
enableCompress
=
SETUNPACKALPHA_ENABLE_COMPRESS
;
dataLimit
=
SETUNPACKALPHA_DATA_LIMIT
;
dataOffset
=
SETUNPACKALPHA_DATA_OFFSET
;
cacheSlots
=
SETUNPACKALPHA_CACHE_SLOTS
;
cacheThreshold
=
SETUNPACKALPHA_CACHE_THRESHOLD
;
cacheLowerThreshold
=
SETUNPACKALPHA_CACHE_LOWER_THRESHOLD
;
messages_
->
resize
(
cacheSlots
);
for
(
T_messages
::
iterator
i
=
messages_
->
begin
();
i
<
messages_
->
end
();
i
++
)
{
*
i
=
NULL
;
}
temporary_
=
NULL
;
}
SetUnpackAlphaCompatStore
::~
SetUnpackAlphaCompatStore
()
{
for
(
T_messages
::
iterator
i
=
messages_
->
begin
();
i
<
messages_
->
end
();
i
++
)
{
destroy
(
*
i
);
}
destroy
(
temporary_
);
}
//
// Here are the methods to handle messages' content.
//
int
SetUnpackAlphaCompatStore
::
encodeIdentity
(
EncodeBuffer
&
encodeBuffer
,
const
unsigned
char
*
buffer
,
const
unsigned
int
size
,
int
bigEndian
,
ChannelCache
*
channelCache
)
const
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Encoding full message identity.
\n
"
<<
logofs_flush
;
#endif
// Client.
encodeBuffer
.
encodeCachedValue
(
*
(
buffer
+
1
),
8
,
clientCache
->
resourceCache
);
// Entries.
encodeBuffer
.
encodeValue
(
GetULONG
(
buffer
+
4
,
bigEndian
),
32
,
9
);
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Encoded full message identity.
\n
"
<<
logofs_flush
;
#endif
return
1
;
}
int
SetUnpackAlphaCompatStore
::
decodeIdentity
(
DecodeBuffer
&
decodeBuffer
,
unsigned
char
*&
buffer
,
unsigned
int
&
size
,
int
bigEndian
,
WriteBuffer
*
writeBuffer
,
ChannelCache
*
channelCache
)
const
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Decoding full message identity.
\n
"
<<
logofs_flush
;
#endif
unsigned
int
value
;
unsigned
char
cValue
;
// Client.
decodeBuffer
.
decodeCachedValue
(
cValue
,
8
,
clientCache
->
resourceCache
);
// Entries.
decodeBuffer
.
decodeValue
(
value
,
32
,
9
);
size
=
RoundUp4
(
value
)
+
8
;
buffer
=
writeBuffer
->
addMessage
(
size
);
*
(
buffer
+
1
)
=
cValue
;
PutULONG
(
value
,
buffer
+
4
,
bigEndian
);
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Decoded full message identity.
\n
"
<<
logofs_flush
;
#endif
return
1
;
}
int
SetUnpackAlphaCompatStore
::
parseIdentity
(
Message
*
message
,
const
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
{
SetUnpackAlphaCompatMessage
*
setUnpackAlpha
=
(
SetUnpackAlphaCompatMessage
*
)
message
;
setUnpackAlpha
->
client
=
*
(
buffer
+
1
);
setUnpackAlpha
->
entries
=
GetULONG
(
buffer
+
4
,
bigEndian
);
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Parsed identity for message at "
<<
message
<<
".
\n
"
<<
logofs_flush
;
#endif
return
1
;
}
int
SetUnpackAlphaCompatStore
::
unparseIdentity
(
const
Message
*
message
,
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
{
SetUnpackAlphaCompatMessage
*
setUnpackAlpha
=
(
SetUnpackAlphaCompatMessage
*
)
message
;
*
(
buffer
+
1
)
=
setUnpackAlpha
->
client
;
PutULONG
(
setUnpackAlpha
->
entries
,
buffer
+
4
,
bigEndian
);
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Unparsed identity for message at "
<<
message
<<
".
\n
"
<<
logofs_flush
;
#endif
return
1
;
}
void
SetUnpackAlphaCompatStore
::
dumpIdentity
(
const
Message
*
message
)
const
{
#ifdef DUMP
SetUnpackAlphaCompatMessage
*
setUnpackAlpha
=
(
SetUnpackAlphaCompatMessage
*
)
message
;
*
logofs
<<
name
()
<<
": Identity client "
<<
(
unsigned
int
)
setUnpackAlpha
->
client
<<
" entries "
<<
setUnpackAlpha
->
entries
<<
" size "
<<
setUnpackAlpha
->
size_
<<
".
\n
"
;
#endif
}
void
SetUnpackAlphaCompatStore
::
identityChecksum
(
const
Message
*
message
,
const
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
{
md5_append
(
md5_state_
,
buffer
+
4
,
4
);
}
void
SetUnpackAlphaCompatStore
::
updateIdentity
(
EncodeBuffer
&
encodeBuffer
,
const
Message
*
message
,
const
Message
*
cachedMessage
,
ChannelCache
*
channelCache
)
const
{
SetUnpackAlphaCompatMessage
*
setUnpackAlpha
=
(
SetUnpackAlphaCompatMessage
*
)
message
;
SetUnpackAlphaCompatMessage
*
cachedSetUnpackAlpha
=
(
SetUnpackAlphaCompatMessage
*
)
cachedMessage
;
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
encodeBuffer
.
encodeCachedValue
(
setUnpackAlpha
->
client
,
8
,
clientCache
->
resourceCache
);
cachedSetUnpackAlpha
->
client
=
setUnpackAlpha
->
client
;
if
(
cachedSetUnpackAlpha
->
entries
!=
setUnpackAlpha
->
entries
)
{
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoding value "
<<
setUnpackAlpha
->
entries
<<
" as entries field.
\n
"
<<
logofs_flush
;
#endif
encodeBuffer
.
encodeBoolValue
(
1
);
encodeBuffer
.
encodeValue
(
setUnpackAlpha
->
entries
,
32
,
9
);
cachedSetUnpackAlpha
->
entries
=
setUnpackAlpha
->
entries
;
}
else
{
encodeBuffer
.
encodeBoolValue
(
0
);
}
}
void
SetUnpackAlphaCompatStore
::
updateIdentity
(
DecodeBuffer
&
decodeBuffer
,
const
Message
*
message
,
ChannelCache
*
channelCache
)
const
{
SetUnpackAlphaCompatMessage
*
setUnpackAlpha
=
(
SetUnpackAlphaCompatMessage
*
)
message
;
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
unsigned
int
value
;
decodeBuffer
.
decodeCachedValue
(
setUnpackAlpha
->
client
,
8
,
clientCache
->
resourceCache
);
decodeBuffer
.
decodeBoolValue
(
value
);
if
(
value
)
{
decodeBuffer
.
decodeValue
(
value
,
32
,
9
);
setUnpackAlpha
->
entries
=
value
;
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Decoded value "
<<
setUnpackAlpha
->
entries
<<
" as entries field.
\n
"
<<
logofs_flush
;
#endif
}
}
nxcomp/SetUnpackAlphaCompat.h
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef SetUnpackAlphaCompat_H
#define SetUnpackAlphaCompat_H
#include "Message.h"
//
// Set the verbosity level.
//
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
#undef DUMP
//
// Set default values.
//
#define SETUNPACKALPHA_ENABLE_CACHE 1
#define SETUNPACKALPHA_ENABLE_DATA 1
#define SETUNPACKALPHA_ENABLE_SPLIT 0
#define SETUNPACKALPHA_ENABLE_COMPRESS 1
#define SETUNPACKALPHA_DATA_LIMIT 16384
#define SETUNPACKALPHA_DATA_OFFSET 8
#define SETUNPACKALPHA_CACHE_SLOTS 2000
#define SETUNPACKALPHA_CACHE_THRESHOLD 10
#define SETUNPACKALPHA_CACHE_LOWER_THRESHOLD 5
//
// The message class.
//
class
SetUnpackAlphaCompatMessage
:
public
Message
{
friend
class
SetUnpackAlphaCompatStore
;
public
:
SetUnpackAlphaCompatMessage
()
{
}
~
SetUnpackAlphaCompatMessage
()
{
}
//
// Put here the fields which constitute
// the 'identity' part of the message.
//
private
:
unsigned
char
client
;
unsigned
int
entries
;
};
class
SetUnpackAlphaCompatStore
:
public
MessageStore
{
public
:
SetUnpackAlphaCompatStore
(
StaticCompressor
*
compressor
);
virtual
~
SetUnpackAlphaCompatStore
();
virtual
const
char
*
name
()
const
{
return
"SetUnpackAlphaCompat"
;
}
virtual
unsigned
char
opcode
()
const
{
return
X_NXSetUnpackAlpha
;
}
virtual
unsigned
int
storage
()
const
{
return
sizeof
(
SetUnpackAlphaCompatMessage
);
}
//
// Message handling methods.
//
protected
:
virtual
Message
*
create
()
const
{
return
new
SetUnpackAlphaCompatMessage
();
}
virtual
Message
*
create
(
const
Message
&
message
)
const
{
return
new
SetUnpackAlphaCompatMessage
((
const
SetUnpackAlphaCompatMessage
&
)
message
);
}
virtual
void
destroy
(
Message
*
message
)
const
{
delete
(
SetUnpackAlphaCompatMessage
*
)
message
;
}
virtual
int
encodeIdentity
(
EncodeBuffer
&
encodeBuffer
,
const
unsigned
char
*
buffer
,
const
unsigned
int
size
,
int
bigEndian
,
ChannelCache
*
channelCache
)
const
;
virtual
int
decodeIdentity
(
DecodeBuffer
&
decodeBuffer
,
unsigned
char
*&
buffer
,
unsigned
int
&
size
,
int
bigEndian
,
WriteBuffer
*
writeBuffer
,
ChannelCache
*
channelCache
)
const
;
virtual
int
parseIdentity
(
Message
*
message
,
const
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
;
virtual
int
unparseIdentity
(
const
Message
*
message
,
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
;
virtual
void
updateIdentity
(
EncodeBuffer
&
encodeBuffer
,
const
Message
*
message
,
const
Message
*
cachedMessage
,
ChannelCache
*
channelCache
)
const
;
virtual
void
updateIdentity
(
DecodeBuffer
&
decodeBuffer
,
const
Message
*
message
,
ChannelCache
*
channelCache
)
const
;
virtual
void
identityChecksum
(
const
Message
*
message
,
const
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
;
virtual
void
dumpIdentity
(
const
Message
*
message
)
const
;
};
#endif
/* SetUnpackAlphaCompat_H */
nxcomp/SetUnpackColormap.cpp
View file @
03b65211
...
@@ -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
);
...
...
nxcomp/SetUnpackColormap.h
View file @
03b65211
...
@@ -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
...
...
nxcomp/SetUnpackColormapCompat.cpp
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#include "SetUnpackColormapCompat.h"
#include "ClientCache.h"
#include "EncodeBuffer.h"
#include "DecodeBuffer.h"
#include "WriteBuffer.h"
//
// Set the verbosity level.
//
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
#undef DUMP
//
// Constructors and destructors.
//
SetUnpackColormapCompatStore
::
SetUnpackColormapCompatStore
(
StaticCompressor
*
compressor
)
:
MessageStore
(
compressor
)
{
enableCache
=
SETUNPACKCOLORMAP_ENABLE_CACHE
;
enableData
=
SETUNPACKCOLORMAP_ENABLE_DATA
;
enableSplit
=
SETUNPACKCOLORMAP_ENABLE_SPLIT
;
enableCompress
=
SETUNPACKCOLORMAP_ENABLE_COMPRESS
;
dataLimit
=
SETUNPACKCOLORMAP_DATA_LIMIT
;
dataOffset
=
SETUNPACKCOLORMAP_DATA_OFFSET
;
cacheSlots
=
SETUNPACKCOLORMAP_CACHE_SLOTS
;
cacheThreshold
=
SETUNPACKCOLORMAP_CACHE_THRESHOLD
;
cacheLowerThreshold
=
SETUNPACKCOLORMAP_CACHE_LOWER_THRESHOLD
;
messages_
->
resize
(
cacheSlots
);
for
(
T_messages
::
iterator
i
=
messages_
->
begin
();
i
<
messages_
->
end
();
i
++
)
{
*
i
=
NULL
;
}
temporary_
=
NULL
;
}
SetUnpackColormapCompatStore
::~
SetUnpackColormapCompatStore
()
{
for
(
T_messages
::
iterator
i
=
messages_
->
begin
();
i
<
messages_
->
end
();
i
++
)
{
destroy
(
*
i
);
}
destroy
(
temporary_
);
}
//
// Here are the methods to handle messages' content.
//
int
SetUnpackColormapCompatStore
::
encodeIdentity
(
EncodeBuffer
&
encodeBuffer
,
const
unsigned
char
*
buffer
,
const
unsigned
int
size
,
int
bigEndian
,
ChannelCache
*
channelCache
)
const
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Encoding full message identity.
\n
"
<<
logofs_flush
;
#endif
// Client.
encodeBuffer
.
encodeCachedValue
(
*
(
buffer
+
1
),
8
,
clientCache
->
resourceCache
);
// Entries.
encodeBuffer
.
encodeValue
(
GetULONG
(
buffer
+
4
,
bigEndian
),
32
,
9
);
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Encoded full message identity.
\n
"
<<
logofs_flush
;
#endif
return
1
;
}
int
SetUnpackColormapCompatStore
::
decodeIdentity
(
DecodeBuffer
&
decodeBuffer
,
unsigned
char
*&
buffer
,
unsigned
int
&
size
,
int
bigEndian
,
WriteBuffer
*
writeBuffer
,
ChannelCache
*
channelCache
)
const
{
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Decoding full message identity.
\n
"
<<
logofs_flush
;
#endif
unsigned
int
value
;
unsigned
char
cValue
;
// Client.
decodeBuffer
.
decodeCachedValue
(
cValue
,
8
,
clientCache
->
resourceCache
);
// Entries.
decodeBuffer
.
decodeValue
(
value
,
32
,
9
);
size
=
(
value
<<
2
)
+
8
;
buffer
=
writeBuffer
->
addMessage
(
size
);
*
(
buffer
+
1
)
=
cValue
;
PutULONG
(
value
,
buffer
+
4
,
bigEndian
);
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Decoded full message identity.
\n
"
<<
logofs_flush
;
#endif
return
1
;
}
int
SetUnpackColormapCompatStore
::
parseIdentity
(
Message
*
message
,
const
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
{
SetUnpackColormapCompatMessage
*
setUnpackColormap
=
(
SetUnpackColormapCompatMessage
*
)
message
;
setUnpackColormap
->
client
=
*
(
buffer
+
1
);
setUnpackColormap
->
entries
=
GetULONG
(
buffer
+
4
,
bigEndian
);
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Parsed identity for message at "
<<
message
<<
".
\n
"
<<
logofs_flush
;
#endif
return
1
;
}
int
SetUnpackColormapCompatStore
::
unparseIdentity
(
const
Message
*
message
,
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
{
SetUnpackColormapCompatMessage
*
setUnpackColormap
=
(
SetUnpackColormapCompatMessage
*
)
message
;
*
(
buffer
+
1
)
=
setUnpackColormap
->
client
;
PutULONG
(
setUnpackColormap
->
entries
,
buffer
+
4
,
bigEndian
);
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Unparsed identity for message at "
<<
message
<<
".
\n
"
<<
logofs_flush
;
#endif
return
1
;
}
void
SetUnpackColormapCompatStore
::
dumpIdentity
(
const
Message
*
message
)
const
{
#ifdef DUMP
SetUnpackColormapCompatMessage
*
setUnpackColormap
=
(
SetUnpackColormapCompatMessage
*
)
message
;
*
logofs
<<
name
()
<<
": Identity client "
<<
(
unsigned
int
)
setUnpackColormap
->
client
<<
" entries "
<<
setUnpackColormap
->
entries
<<
" size "
<<
setUnpackColormap
->
size_
<<
".
\n
"
;
#endif
}
void
SetUnpackColormapCompatStore
::
identityChecksum
(
const
Message
*
message
,
const
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
{
md5_append
(
md5_state_
,
buffer
+
4
,
4
);
}
void
SetUnpackColormapCompatStore
::
updateIdentity
(
EncodeBuffer
&
encodeBuffer
,
const
Message
*
message
,
const
Message
*
cachedMessage
,
ChannelCache
*
channelCache
)
const
{
SetUnpackColormapCompatMessage
*
setUnpackColormap
=
(
SetUnpackColormapCompatMessage
*
)
message
;
SetUnpackColormapCompatMessage
*
cachedSetUnpackColormap
=
(
SetUnpackColormapCompatMessage
*
)
cachedMessage
;
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoding value "
<<
(
unsigned
int
)
setUnpackColormap
->
client
<<
" as client field.
\n
"
<<
logofs_flush
;
#endif
encodeBuffer
.
encodeCachedValue
(
setUnpackColormap
->
client
,
8
,
clientCache
->
resourceCache
);
cachedSetUnpackColormap
->
client
=
setUnpackColormap
->
client
;
if
(
cachedSetUnpackColormap
->
entries
!=
setUnpackColormap
->
entries
)
{
#ifdef TEST
*
logofs
<<
name
()
<<
": Encoding value "
<<
setUnpackColormap
->
entries
<<
" as entries field.
\n
"
<<
logofs_flush
;
#endif
encodeBuffer
.
encodeBoolValue
(
1
);
encodeBuffer
.
encodeValue
(
setUnpackColormap
->
entries
,
32
,
9
);
cachedSetUnpackColormap
->
entries
=
setUnpackColormap
->
entries
;
}
else
{
encodeBuffer
.
encodeBoolValue
(
0
);
}
}
void
SetUnpackColormapCompatStore
::
updateIdentity
(
DecodeBuffer
&
decodeBuffer
,
const
Message
*
message
,
ChannelCache
*
channelCache
)
const
{
SetUnpackColormapCompatMessage
*
setUnpackColormap
=
(
SetUnpackColormapCompatMessage
*
)
message
;
ClientCache
*
clientCache
=
(
ClientCache
*
)
channelCache
;
unsigned
int
value
;
decodeBuffer
.
decodeCachedValue
(
setUnpackColormap
->
client
,
8
,
clientCache
->
resourceCache
);
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Decoded value "
<<
(
unsigned
int
)
setUnpackColormap
->
client
<<
" as client field.
\n
"
<<
logofs_flush
;
#endif
decodeBuffer
.
decodeBoolValue
(
value
);
if
(
value
)
{
decodeBuffer
.
decodeValue
(
value
,
32
,
9
);
setUnpackColormap
->
entries
=
value
;
#ifdef DEBUG
*
logofs
<<
name
()
<<
": Decoded value "
<<
setUnpackColormap
->
entries
<<
" as entries field.
\n
"
<<
logofs_flush
;
#endif
}
}
nxcomp/SetUnpackColormapCompat.h
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef SetUnpackColormapCompat_H
#define SetUnpackColormapCompat_H
#include "Message.h"
//
// Set the verbosity level.
//
#define PANIC
#define WARNING
#undef TEST
#undef DEBUG
#undef DUMP
//
// Set default values.
//
#define SETUNPACKCOLORMAP_ENABLE_CACHE 1
#define SETUNPACKCOLORMAP_ENABLE_DATA 1
#define SETUNPACKCOLORMAP_ENABLE_SPLIT 1
#define SETUNPACKCOLORMAP_ENABLE_COMPRESS 1
#define SETUNPACKCOLORMAP_DATA_LIMIT 4096
#define SETUNPACKCOLORMAP_DATA_OFFSET 8
#define SETUNPACKCOLORMAP_CACHE_SLOTS 2000
#define SETUNPACKCOLORMAP_CACHE_THRESHOLD 5
#define SETUNPACKCOLORMAP_CACHE_LOWER_THRESHOLD 0
//
// The message class.
//
class
SetUnpackColormapCompatMessage
:
public
Message
{
friend
class
SetUnpackColormapCompatStore
;
public
:
SetUnpackColormapCompatMessage
()
{
}
~
SetUnpackColormapCompatMessage
()
{
}
//
// Put here the fields which constitute
// the 'identity' part of the message.
//
private
:
unsigned
char
client
;
unsigned
int
entries
;
};
class
SetUnpackColormapCompatStore
:
public
MessageStore
{
public
:
SetUnpackColormapCompatStore
(
StaticCompressor
*
compressor
);
virtual
~
SetUnpackColormapCompatStore
();
virtual
const
char
*
name
()
const
{
return
"SetUnpackColormapCompat"
;
}
virtual
unsigned
char
opcode
()
const
{
return
X_NXSetUnpackColormap
;
}
virtual
unsigned
int
storage
()
const
{
return
sizeof
(
SetUnpackColormapCompatMessage
);
}
//
// Message handling methods.
//
protected
:
virtual
Message
*
create
()
const
{
return
new
SetUnpackColormapCompatMessage
();
}
virtual
Message
*
create
(
const
Message
&
message
)
const
{
return
new
SetUnpackColormapCompatMessage
((
const
SetUnpackColormapCompatMessage
&
)
message
);
}
virtual
void
destroy
(
Message
*
message
)
const
{
delete
(
SetUnpackColormapCompatMessage
*
)
message
;
}
virtual
int
encodeIdentity
(
EncodeBuffer
&
encodeBuffer
,
const
unsigned
char
*
buffer
,
const
unsigned
int
size
,
int
bigEndian
,
ChannelCache
*
channelCache
)
const
;
virtual
int
decodeIdentity
(
DecodeBuffer
&
decodeBuffer
,
unsigned
char
*&
buffer
,
unsigned
int
&
size
,
int
bigEndian
,
WriteBuffer
*
writeBuffer
,
ChannelCache
*
channelCache
)
const
;
virtual
int
parseIdentity
(
Message
*
message
,
const
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
;
virtual
int
unparseIdentity
(
const
Message
*
message
,
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
;
virtual
void
updateIdentity
(
EncodeBuffer
&
encodeBuffer
,
const
Message
*
message
,
const
Message
*
cachedMessage
,
ChannelCache
*
channelCache
)
const
;
virtual
void
updateIdentity
(
DecodeBuffer
&
decodeBuffer
,
const
Message
*
message
,
ChannelCache
*
channelCache
)
const
;
virtual
void
identityChecksum
(
const
Message
*
message
,
const
unsigned
char
*
buffer
,
unsigned
int
size
,
int
bigEndian
)
const
;
virtual
void
dumpIdentity
(
const
Message
*
message
)
const
;
};
#endif
/* SetUnpackColormapCompat_H */
nxcomp/ShapeExtension.cpp
View file @
03b65211
...
@@ -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
;
...
...
nxcomp/ShapeExtension.h
View file @
03b65211
...
@@ -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
...
...
nxcomp/Split.cpp
View file @
03b65211
...
@@ -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
);
...
...
nxcomp/TextCompressor.cpp
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#include "TextCompressor.h"
#include "EncodeBuffer.h"
#include "DecodeBuffer.h"
//
// The compression obtained by this class is
// very poor. In newer versions the text is
// simply appended to the encode buffer and
// compressed by leveraging the final stream
// compression.
//
void
TextCompressor
::
encodeChar
(
unsigned
char
ch
,
EncodeBuffer
&
encodeBuffer
)
{
// encode each successive character of text using
// a predictive model where most of the last 3 characters
// (low order 7 bits of the previous character, plus the
// low order 5 bits of the character before that, plus
// the low order 3 bits of the character before that)
// are used to find the right cache...
CharCache
&
cache
=
cache_
[
key_
%
cacheSize_
];
if
((
key_
>=
128
)
&&
(
cache
.
getSize
()
==
0
))
{
// 3rd-order model doesn't have any statistics yet,
// so use the 1st-order one instead
CharCache
&
cache2
=
cache_
[(
key_
&
0x7f
)
%
cacheSize_
];
encodeBuffer
.
encodeCachedValue
((
unsigned
int
)
ch
,
8
,
cache2
);
cache
.
insert
(
ch
);
}
else
{
encodeBuffer
.
encodeCachedValue
((
unsigned
int
)
ch
,
8
,
cache
);
}
key_
=
(((
key_
&
0x1f
)
<<
7
)
|
((
key_
&
0x380
)
<<
5
)
|
(
ch
&
0x7f
));
}
unsigned
char
TextCompressor
::
decodeChar
(
DecodeBuffer
&
decodeBuffer
)
{
unsigned
char
nextChar
;
CharCache
&
cache
=
cache_
[
key_
%
cacheSize_
];
if
((
key_
>=
128
)
&&
(
cache
.
getSize
()
==
0
))
{
CharCache
&
cache2
=
cache_
[(
key_
&
0x7f
)
%
cacheSize_
];
decodeBuffer
.
decodeCachedValue
(
nextChar
,
8
,
cache2
);
cache
.
insert
(
nextChar
);
}
else
{
decodeBuffer
.
decodeCachedValue
(
nextChar
,
8
,
cache
);
}
key_
=
(((
key_
&
0x1f
)
<<
7
)
|
((
key_
&
0x380
)
<<
5
)
|
(
nextChar
&
0x7f
));
return
nextChar
;
}
nxcomp/TextCompressor.h
deleted
100644 → 0
View file @
2ffe52c5
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */
/* */
/* NXCOMP, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#ifndef TextCompressor_H
#define TextCompressor_H
#include "CharCache.h"
class
EncodeBuffer
;
class
DecodeBuffer
;
class
TextCompressor
{
public
:
TextCompressor
(
CharCache
*
cache
,
unsigned
int
cacheSize
)
:
cache_
(
cache
),
cacheSize_
(
cacheSize
),
key_
(
0
)
{
}
void
encodeChar
(
unsigned
char
ch
,
EncodeBuffer
&
);
unsigned
char
decodeChar
(
DecodeBuffer
&
);
void
reset
(
unsigned
int
newKey
=
0
)
{
key_
=
newKey
;
}
private
:
CharCache
*
cache_
;
unsigned
int
cacheSize_
;
unsigned
int
key_
;
};
#endif
/* TextCompressor_H */
nxcomp/Types.h
View file @
03b65211
...
@@ -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
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment