Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
libvncserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
rasky
libvncserver
Commits
dd26262a
Commit
dd26262a
authored
May 14, 2004
by
runge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x11vnc: more -inetd fixes.
parent
de95a568
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
3 deletions
+34
-3
x11vnc.c
contrib/x11vnc.c
+34
-3
No files found.
contrib/x11vnc.c
View file @
dd26262a
...
@@ -437,10 +437,31 @@ void set_signals(void) {
...
@@ -437,10 +437,31 @@ void set_signals(void) {
X_UNLOCK
;
X_UNLOCK
;
}
}
int
accepted_client
=
0
;
void
client_gone
(
rfbClientPtr
client
)
{
void
client_gone
(
rfbClientPtr
client
)
{
client_count
--
;
client_count
--
;
rfbLog
(
"client_count: %d
\n
"
,
client_count
);
rfbLog
(
"client_count: %d
\n
"
,
client_count
);
if
(
inetd
)
{
rfbLog
(
"viewer exited.
\n
"
);
clean_up_exit
(
0
);
}
if
(
connect_once
)
{
if
(
connect_once
)
{
/*
* This non-exit is done for a bad passwd to be consistent
* with our RFB_CLIENT_REFUSE behavior in new_client() (i.e.
* we disconnect after 1 successful connection).
*/
if
(
client
->
state
==
RFB_PROTOCOL_VERSION
||
client
->
state
==
RFB_AUTHENTICATION
&&
accepted_client
)
{
rfbLog
(
"connect_once: bad password or early "
"disconnect.
\n
"
);
rfbLog
(
"connect_once: waiting for next connection.
\n
"
);
accepted_client
=
0
;
return
;
}
rfbLog
(
"viewer exited.
\n
"
);
rfbLog
(
"viewer exited.
\n
"
);
clean_up_exit
(
0
);
clean_up_exit
(
0
);
}
}
...
@@ -969,9 +990,16 @@ void check_connect_inputs() {
...
@@ -969,9 +990,16 @@ void check_connect_inputs() {
* libvncserver callback for when a new client connects
* libvncserver callback for when a new client connects
*/
*/
enum
rfbNewClientAction
new_client
(
rfbClientPtr
client
)
{
enum
rfbNewClientAction
new_client
(
rfbClientPtr
client
)
{
static
int
accepted_client
=
0
;
last_event
=
last_input
=
time
(
0
);
last_event
=
last_input
=
time
(
0
);
if
(
inetd
)
{
/*
* Set this so we exit as soon as connection closes,
* otherwise client_gone is only called after RFB_CLIENT_ACCEPT
*/
client
->
clientGoneHook
=
client_gone
;
}
if
(
connect_once
)
{
if
(
connect_once
)
{
if
(
screen
->
rfbDontDisconnect
&&
screen
->
rfbNeverShared
)
{
if
(
screen
->
rfbDontDisconnect
&&
screen
->
rfbNeverShared
)
{
if
(
!
shared
&&
accepted_client
)
{
if
(
!
shared
&&
accepted_client
)
{
...
@@ -994,15 +1022,18 @@ enum rfbNewClientAction new_client(rfbClientPtr client) {
...
@@ -994,15 +1022,18 @@ enum rfbNewClientAction new_client(rfbClientPtr client) {
return
(
RFB_CLIENT_REFUSE
);
return
(
RFB_CLIENT_REFUSE
);
}
}
client
->
clientGoneHook
=
client_gone
;
if
(
view_only
)
{
if
(
view_only
)
{
client
->
clientData
=
(
void
*
)
-
1
;
client
->
clientData
=
(
void
*
)
-
1
;
}
else
{
}
else
{
client
->
clientData
=
(
void
*
)
0
;
client
->
clientData
=
(
void
*
)
0
;
}
}
client
->
clientGoneHook
=
client_gone
;
client_count
++
;
accepted_client
=
1
;
accepted_client
=
1
;
last_client
=
time
(
0
);
last_client
=
time
(
0
);
client_count
++
;
return
(
RFB_CLIENT_ACCEPT
);
return
(
RFB_CLIENT_ACCEPT
);
}
}
...
...
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