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
ab3974f2
Unverified
Commit
ab3974f2
authored
Apr 07, 2017
by
Vadim Troshchinskiy
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'sunweaver-pr/pr/nxproxy-read-from-stdin' into 3.6.x
parents
dcdbc102
4c2fe0d9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
14 deletions
+65
-14
Loop.cpp
nxcomp/Loop.cpp
+1
-1
Main.c
nxproxy/Main.c
+64
-13
No files found.
nxcomp/Loop.cpp
View file @
ab3974f2
...
@@ -13940,7 +13940,7 @@ void PrintProcessInfo()
...
@@ -13940,7 +13940,7 @@ void PrintProcessInfo()
//
//
cerr
<<
"Info: Proxy running in "
cerr
<<
"Info: Proxy running in "
<<
(
control
->
ProxyMode
==
proxy_client
?
"
server"
:
"client
"
)
<<
(
control
->
ProxyMode
==
proxy_client
?
"
client"
:
"server
"
)
<<
" mode with pid '"
<<
getpid
()
<<
"'.
\n
"
;
<<
" mode with pid '"
<<
getpid
()
<<
"'.
\n
"
;
if
(
agent
==
NULL
)
if
(
agent
==
NULL
)
...
...
nxproxy/Main.c
View file @
ab3974f2
...
@@ -19,6 +19,8 @@
...
@@ -19,6 +19,8 @@
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <unistd.h>
#include <unistd.h>
#include <errno.h>
#include <limits.h>
#include "NX.h"
#include "NX.h"
...
@@ -27,6 +29,8 @@
...
@@ -27,6 +29,8 @@
#undef TEST
#undef TEST
#undef DEBUG
#undef DEBUG
extern
const
char
*
__progname
;
/*
/*
* Entry point when running nxproxy stand-alone.
* Entry point when running nxproxy stand-alone.
*/
*/
...
@@ -37,27 +41,74 @@ int main(int argc, const char **argv)
...
@@ -37,27 +41,74 @@ int main(int argc, const char **argv)
char
*
options
=
NULL
;
char
*
options
=
NULL
;
char
*
nx_commfd_str
=
NULL
;
options
=
getenv
(
"NX_DISPLAY"
);
options
=
getenv
(
"NX_DISPLAY"
);
if
(
NXTransParseCommandLine
(
argc
,
argv
)
<
0
)
if
(
(
nx_commfd_str
=
getenv
(
"NX_COMMFD"
))
!=
NULL
)
{
{
NXTransCleanup
()
;
errno
=
0
;
}
unsigned
long
int
nx_commfd
=
strtoul
(
nx_commfd_str
,
NULL
,
10
);
if
(
NXTransParseEnvironment
(
options
,
0
)
<
0
)
if
((
errno
)
&&
(
0
==
nx_commfd
))
{
{
NXTransCleanup
();
fprintf
(
stderr
,
"%s: NX_COMMFD environment variable's value [%s] is not a file descriptor number. "
"Aborting...
\n
"
,
__progname
,
nx_commfd_str
);
NXTransCleanup
();
}
else
if
((
unsigned
long
int
)
INT_MAX
<
nx_commfd
)
{
fprintf
(
stderr
,
"%s: NX_COMMFD environment variable's value [%lu] is out of range for a file descriptor number. "
"Aborting...
\n
"
,
__progname
,
nx_commfd
);
NXTransCleanup
();
}
else
{
result
=
NXTransCreate
(
nx_commfd
,
NX_MODE_SERVER
,
options
);
if
(
result
!=
1
)
{
fprintf
(
stderr
,
"%s: NXTransCreate failed for FD#%lu
\n
"
"Aborting..."
,
__progname
,
nx_commfd
);
NXTransCleanup
();
}
}
// go into endless loop
if
(
result
==
1
)
{
while
(
NXTransRunning
(
NX_FD_ANY
))
result
=
NXTransContinue
(
NULL
);
}
}
}
else
{
/*
if
(
NXTransParseCommandLine
(
argc
,
argv
)
<
0
)
* This should not return...
{
*/
NXTransCleanup
();
}
#ifdef TEST
if
(
NXTransParseEnvironment
(
options
,
0
)
<
0
)
fprintf
(
stderr
,
"Main: Yielding control to NX entry point.
\n
"
);
{
#endif
NXTransCleanup
();
}
result
=
NXTransProxy
(
NX_FD_ANY
,
NX_MODE_ANY
,
NX_DISPLAY_ANY
);
/*
* This should not return...
*/
#ifdef TEST
fprintf
(
stderr
,
"%s: Yielding control to NX entry point.
\n
"
,
__progname
);
#endif
result
=
NXTransProxy
(
NX_FD_ANY
,
NX_MODE_ANY
,
NX_DISPLAY_ANY
);
}
/*
/*
* ...So these should not be called.
* ...So these should not be called.
...
...
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