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
2dd1a1fe
Unverified
Commit
2dd1a1fe
authored
Jun 18, 2016
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'Ionic-feature/configurablesleep' into 3.6.x
Attributes GH PR #143:
https://github.com/ArcticaProject/nx-libs/pull/143
parents
3dea5a88
6051dec4
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
87 additions
and
26 deletions
+87
-26
Args.c
nx-X11/programs/Xserver/hw/nxagent/Args.c
+38
-0
Handlers.c
nx-X11/programs/Xserver/hw/nxagent/Handlers.c
+33
-13
Image.c
nx-X11/programs/Xserver/hw/nxagent/Image.c
+3
-11
Options.c
nx-X11/programs/Xserver/hw/nxagent/Options.c
+2
-0
Options.h
nx-X11/programs/Xserver/hw/nxagent/Options.h
+7
-0
Loop.cpp
nxcomp/Loop.cpp
+2
-1
Misc.cpp
nxcomp/Misc.cpp
+2
-1
No files found.
nx-X11/programs/Xserver/hw/nxagent/Args.c
View file @
2dd1a1fe
...
@@ -1339,6 +1339,44 @@ static void nxagentParseOptions(char *name, char *value)
...
@@ -1339,6 +1339,44 @@ static void nxagentParseOptions(char *name, char *value)
nxagentChangeOption
(
Clipboard
,
ClipboardBoth
);
nxagentChangeOption
(
Clipboard
,
ClipboardBoth
);
}
}
}
}
else
if
(
!
strcmp
(
name
,
"sleep"
))
{
long
sleep_parse
=
0
;
errno
=
0
;
sleep_parse
=
strtol
(
value
,
NULL
,
10
);
if
((
errno
)
&&
(
0
==
sleep_parse
))
{
fprintf
(
stderr
,
"nxagentParseOptions: Unable to convert value [%s] of option [%s]. "
"Ignoring option.
\n
"
,
validateString
(
value
),
validateString
(
name
));
return
;
}
if
((
long
)
UINT_MAX
<
sleep_parse
)
{
sleep_parse
=
UINT_MAX
;
fprintf
(
stderr
,
"nxagentParseOptions: Warning: value [%s] of option [%s] "
"out of range, clamped to [%u].
\n
"
,
validateString
(
value
),
validateString
(
name
),
sleep_parse
);
}
if
(
0
>
sleep_parse
)
{
sleep_parse
=
0
;
fprintf
(
stderr
,
"nxagentParseOptions: Warning: value [%s] of option [%s] "
"out of range, clamped to [%u].
\n
"
,
validateString
(
value
),
validateString
(
name
),
sleep_parse
);
}
nxagentChangeOption
(
SleepTime
,
sleep_parse
);
return
;
}
else
else
{
{
#ifdef DEBUG
#ifdef DEBUG
...
...
nx-X11/programs/Xserver/hw/nxagent/Handlers.c
View file @
2dd1a1fe
...
@@ -63,14 +63,6 @@
...
@@ -63,14 +63,6 @@
#define FLUSH_AFTER_MULTIPLE_READS
#define FLUSH_AFTER_MULTIPLE_READS
/*
/*
* Introduce a small delay after each
* loop if the session is down. The
* value is in milliseconds.
*/
#define LOOP_DELAY_IF_DOWN 50
/*
* The soft limit should roughly match
* The soft limit should roughly match
* the size of the Xlib I/O buffer.
* the size of the Xlib I/O buffer.
*/
*/
...
@@ -246,12 +238,21 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
...
@@ -246,12 +238,21 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
* not connected to a valid display.
* not connected to a valid display.
*/
*/
if
(
NXDisplayError
(
nxagentDisplay
)
==
1
&&
nxagentShadowCounter
==
0
)
if
(
NXDisplayError
(
nxagentDisplay
)
==
1
&&
nxagentShadowCounter
==
0
&&
nxagentOption
(
SleepTime
)
>
0
)
{
{
usleep
(
LOOP_DELAY_IF_DOWN
*
1000
);
#ifdef TEST
fprintf
(
stderr
,
"nxagentBlockHandler: sleeping for %d milliseconds for slowdown.
\n
"
,
nxagentOption
(
SleepTime
));
#endif
usleep
(
nxagentOption
(
SleepTime
)
*
1000
);
now
=
GetTimeInMillis
();
now
=
GetTimeInMillis
();
}
}
#ifdef TEST
else
if
(
0
==
nxagentOption
(
SleepTime
))
{
fprintf
(
stderr
,
"nxagentBlockHandler: not sleeping for slowdown.
\n
"
);
}
#endif
/*
/*
* Update the shadow display. This is
* Update the shadow display. This is
...
@@ -743,9 +744,17 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas
...
@@ -743,9 +744,17 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas
nxagentHandleConnectionChanges
();
nxagentHandleConnectionChanges
();
}
}
if
(
nxagentSessionState
==
SESSION_DOWN
)
if
(
nxagentSessionState
==
SESSION_DOWN
&&
nxagentOption
(
SleepTime
)
>
0
)
{
{
usleep
(
50
*
1000
);
#ifdef TEST
fprintf
(
stderr
,
"nxagentBlockHandler: sleeping for %d milliseconds for slowdown.
\n
"
,
nxagentOption
(
SleepTime
));
#endif
usleep
(
nxagentOption
(
SleepTime
)
*
1000
);
}
#ifdef TEST
else
if
(
0
==
nxagentOption
(
SleepTime
))
{
fprintf
(
stderr
,
"nxagentBlockHandler: not sleeping for slowdown.
\n
"
);
}
}
#ifndef __CYGWIN32__
#ifndef __CYGWIN32__
...
@@ -826,7 +835,18 @@ FIXME: Must queue multiple writes and handle
...
@@ -826,7 +835,18 @@ FIXME: Must queue multiple writes and handle
#ifdef __CYGWIN32__
#ifdef __CYGWIN32__
usleep
(
50
*
1000
);
if
(
nxagentOption
(
SleepTime
)
>
0
)
{
#ifdef TEST
fprintf
(
stderr
,
"nxagentShadowBlockHandler: sleeping for %d milliseconds for slowdown.
\n
"
,
nxagentOption
(
SleepTime
));
#endif
usleep
(
nxagentOption
(
SleepTime
)
*
1000
);
}
#ifdef TEST
else
if
(
0
==
nxagentOption
(
SleepTime
))
{
fprintf
(
stderr
,
"nxagentShadowBlockHandler: not sleeping for slowdown.
\n
"
);
}
#endif
(
*
timeout
)
->
tv_sec
=
0
;
(
*
timeout
)
->
tv_sec
=
0
;
(
*
timeout
)
->
tv_usec
=
50
*
1000
;
(
*
timeout
)
->
tv_usec
=
50
*
1000
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Image.c
View file @
2dd1a1fe
...
@@ -69,15 +69,6 @@
...
@@ -69,15 +69,6 @@
#define IMAGE_UNIQUE_RATIO 10
#define IMAGE_UNIQUE_RATIO 10
/*
/*
* Introduce a small delay after each image
* operation if the session is down. Value
* is in microseconds and is multiplied by
* the image data size in kilobytes.
*/
#define IMAGE_DELAY_IF_DOWN 250
/*
* Preferred pack and split parameters we
* Preferred pack and split parameters we
* got from the NX transport.
* got from the NX transport.
*/
*/
...
@@ -521,11 +512,12 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
...
@@ -521,11 +512,12 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
length
=
nxagentImageLength
(
dstWidth
,
dstHeight
,
format
,
leftPad
,
depth
);
length
=
nxagentImageLength
(
dstWidth
,
dstHeight
,
format
,
leftPad
,
depth
);
if
(
nxagentShadowCounter
==
0
&&
if
(
nxagentShadowCounter
==
0
&&
NXDisplayError
(
nxagentDisplay
)
==
1
)
NXDisplayError
(
nxagentDisplay
)
==
1
&&
nxagentOption
(
SleepTime
)
>
0
)
{
{
int
us
;
int
us
;
us
=
IMAGE_DELAY_IF_DOWN
*
(
length
/
1024
);
us
=
nxagentOption
(
SleepTime
)
*
4
*
(
length
/
1024
);
us
=
(
us
<
10000
?
10000
:
(
us
>
1000000
?
1000000
:
us
));
us
=
(
us
<
10000
?
10000
:
(
us
>
1000000
?
1000000
:
us
));
...
...
nx-X11/programs/Xserver/hw/nxagent/Options.c
View file @
2dd1a1fe
...
@@ -156,6 +156,8 @@ void nxagentInitOptions()
...
@@ -156,6 +156,8 @@ void nxagentInitOptions()
nxagentOptions
.
ImageRateLimit
=
0
;
nxagentOptions
.
ImageRateLimit
=
0
;
nxagentOptions
.
Xinerama
=
0
;
nxagentOptions
.
Xinerama
=
0
;
nxagentOptions
.
SleepTime
=
DEFAULT_SLEEP_TIME
;
}
}
/*
/*
...
...
nx-X11/programs/Xserver/hw/nxagent/Options.h
View file @
2dd1a1fe
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#define UNDEFINED -1
#define UNDEFINED -1
#define COPY_UNLIMITED -1
#define COPY_UNLIMITED -1
#define DEFAULT_SLEEP_TIME 50
extern
unsigned
int
nxagentPrintGeometryFlags
;
extern
unsigned
int
nxagentPrintGeometryFlags
;
...
@@ -399,6 +400,12 @@ typedef struct _AgentOptions
...
@@ -399,6 +400,12 @@ typedef struct _AgentOptions
int
Xinerama
;
int
Xinerama
;
/*
* Sleep delay in microseconds.
*/
unsigned
int
SleepTime
;
}
AgentOptionsRec
;
}
AgentOptionsRec
;
typedef
AgentOptionsRec
*
AgentOptionsPtr
;
typedef
AgentOptionsRec
*
AgentOptionsPtr
;
...
...
nxcomp/Loop.cpp
View file @
2dd1a1fe
...
@@ -9003,7 +9003,8 @@ int ParseEnvironmentOptions(const char *env, int force)
...
@@ -9003,7 +9003,8 @@ int ParseEnvironmentOptions(const char *env, int force)
strcasecmp
(
name
,
"keyboard"
)
==
0
||
strcasecmp
(
name
,
"keyboard"
)
==
0
||
strcasecmp
(
name
,
"clipboard"
)
==
0
||
strcasecmp
(
name
,
"clipboard"
)
==
0
||
strcasecmp
(
name
,
"streaming"
)
==
0
||
strcasecmp
(
name
,
"streaming"
)
==
0
||
strcasecmp
(
name
,
"backingstore"
)
==
0
)
strcasecmp
(
name
,
"backingstore"
)
==
0
||
strcasecmp
(
name
,
"sleep"
)
==
0
)
{
{
#ifdef DEBUG
#ifdef DEBUG
*
logofs
<<
"Loop: Ignoring agent option '"
<<
name
*
logofs
<<
"Loop: Ignoring agent option '"
<<
name
...
...
nxcomp/Misc.cpp
View file @
2dd1a1fe
...
@@ -316,7 +316,8 @@ shadowuid=n\n\
...
@@ -316,7 +316,8 @@ shadowuid=n\n\
shadowmode=s
\n
\
shadowmode=s
\n
\
defer=n
\n
\
defer=n
\n
\
tile=s
\n
\
tile=s
\n
\
menu=n These options are interpreted by the NX agent. They
\n
\
menu=n
\n
\
sleep=n These options are interpreted by the NX agent. They
\n
\
are ignored by the proxy.
\n
\
are ignored by the proxy.
\n
\
\n
\
\n
\
Environment:
\n
\
Environment:
\n
\
...
...
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