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
f52cfa65
Commit
f52cfa65
authored
Feb 28, 2006
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add handleEventsEagerly flag (Thanks, Donald)
parent
79310af7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
97 additions
and
84 deletions
+97
-84
AUTHORS
AUTHORS
+1
-1
ChangeLog
ChangeLog
+4
-0
main.c
libvncserver/main.c
+2
-0
sockets.c
libvncserver/sockets.c
+86
-82
rfb.h
rfb/rfb.h
+4
-1
No files found.
AUTHORS
View file @
f52cfa65
...
@@ -28,7 +28,7 @@ email!): Akira Hatakeyama, Karl J. Runge, Justin "Zippy" Dearing,
...
@@ -28,7 +28,7 @@ email!): Akira Hatakeyama, Karl J. Runge, Justin "Zippy" Dearing,
Oliver Mihatsch, Greg Sternberg, Werner Hofer, Giampiero Giancipoli,
Oliver Mihatsch, Greg Sternberg, Werner Hofer, Giampiero Giancipoli,
Glenn Mabutt, Paul Kreiner, Erik Kunze, Mike Frysinger, Martin Waitz,
Glenn Mabutt, Paul Kreiner, Erik Kunze, Mike Frysinger, Martin Waitz,
Mark McLoughlin, Paul Fox, Juan Jose Costello, Andre Leiadella,
Mark McLoughlin, Paul Fox, Juan Jose Costello, Andre Leiadella,
Alberto Lusiani, Malvina Mazin, Dave Stuart.
Alberto Lusiani, Malvina Mazin, Dave Stuart
, Rohit Kumar, and Donald Dugger
.
Probably I forgot quite a few people sending a patch here and there, which
Probably I forgot quite a few people sending a patch here and there, which
really made a difference. Without those, some obscure bugs still would
really made a difference. Without those, some obscure bugs still would
...
...
ChangeLog
View file @
f52cfa65
2006-02-28 Donald Dugger <donald.d.dugger@intel.com>
* rfb.h, sockets.c, main.c: add a flag to handle all pending
input events instead of one at a time.
2006-02-24 Karl Runge <runge@karlrunge.com>
2006-02-24 Karl Runge <runge@karlrunge.com>
* x11vnc: -unixpw and -stunnel options. Add clipboard input
* x11vnc: -unixpw and -stunnel options. Add clipboard input
to per-client input controls.
to per-client input controls.
...
...
libvncserver/main.c
View file @
f52cfa65
...
@@ -796,6 +796,8 @@ rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv,
...
@@ -796,6 +796,8 @@ rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv,
screen
->
deferUpdateTime
=
5
;
screen
->
deferUpdateTime
=
5
;
screen
->
maxRectsPerUpdate
=
50
;
screen
->
maxRectsPerUpdate
=
50
;
screen
->
handleEventsEagerly
=
FALSE
;
if
(
!
rfbProcessArguments
(
screen
,
argc
,
argv
))
{
if
(
!
rfbProcessArguments
(
screen
,
argc
,
argv
))
{
free
(
screen
);
free
(
screen
);
return
NULL
;
return
NULL
;
...
...
libvncserver/sockets.c
View file @
f52cfa65
...
@@ -213,7 +213,7 @@ void rfbShutdownSockets(rfbScreenInfoPtr rfbScreen)
...
@@ -213,7 +213,7 @@ void rfbShutdownSockets(rfbScreenInfoPtr rfbScreen)
* rfbProcessClientMessage, etc).
* rfbProcessClientMessage, etc).
*/
*/
void
int
rfbCheckFds
(
rfbScreenInfoPtr
rfbScreen
,
long
usec
)
rfbCheckFds
(
rfbScreenInfoPtr
rfbScreen
,
long
usec
)
{
{
int
nfds
;
int
nfds
;
...
@@ -232,108 +232,112 @@ rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
...
@@ -232,108 +232,112 @@ rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
rfbScreen
->
inetdInitDone
=
TRUE
;
rfbScreen
->
inetdInitDone
=
TRUE
;
}
}
memcpy
((
char
*
)
&
fds
,
(
char
*
)
&
(
rfbScreen
->
allFds
),
sizeof
(
fd_set
));
do
{
tv
.
tv_sec
=
0
;
memcpy
((
char
*
)
&
fds
,
(
char
*
)
&
(
rfbScreen
->
allFds
),
sizeof
(
fd_set
));
tv
.
tv_usec
=
usec
;
tv
.
tv_sec
=
0
;
nfds
=
select
(
rfbScreen
->
maxFd
+
1
,
&
fds
,
NULL
,
NULL
/* &fds */
,
&
tv
);
tv
.
tv_usec
=
usec
;
if
(
nfds
==
0
)
{
nfds
=
select
(
rfbScreen
->
maxFd
+
1
,
&
fds
,
NULL
,
NULL
/* &fds */
,
&
tv
);
return
;
if
(
nfds
==
0
)
{
}
return
0
;
if
(
nfds
<
0
)
{
}
if
(
nfds
<
0
)
{
#ifdef WIN32
#ifdef WIN32
errno
=
WSAGetLastError
();
errno
=
WSAGetLastError
();
#endif
#endif
if
(
errno
!=
EINTR
)
if
(
errno
!=
EINTR
)
rfbLogPerror
(
"rfbCheckFds: select"
);
rfbLogPerror
(
"rfbCheckFds: select"
);
return
;
return
0
;
}
}
if
(
rfbScreen
->
listenSock
!=
-
1
&&
FD_ISSET
(
rfbScreen
->
listenSock
,
&
fds
))
{
if
(
rfbScreen
->
listenSock
!=
-
1
&&
FD_ISSET
(
rfbScreen
->
listenSock
,
&
fds
))
{
if
((
sock
=
accept
(
rfbScreen
->
listenSock
,
if
((
sock
=
accept
(
rfbScreen
->
listenSock
,
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
))
<
0
)
{
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
))
<
0
)
{
rfbLogPerror
(
"rfbCheckFds: accept"
);
rfbLogPerror
(
"rfbCheckFds: accept"
);
return
;
return
0
;
}
}
#ifndef WIN32
#ifndef WIN32
if
(
fcntl
(
sock
,
F_SETFL
,
O_NONBLOCK
)
<
0
)
{
if
(
fcntl
(
sock
,
F_SETFL
,
O_NONBLOCK
)
<
0
)
{
rfbLogPerror
(
"rfbCheckFds: fcntl"
);
rfbLogPerror
(
"rfbCheckFds: fcntl"
);
closesocket
(
sock
);
closesocket
(
sock
);
return
;
return
0
;
}
}
#endif
#endif
if
(
setsockopt
(
sock
,
IPPROTO_TCP
,
TCP_NODELAY
,
if
(
setsockopt
(
sock
,
IPPROTO_TCP
,
TCP_NODELAY
,
(
char
*
)
&
one
,
sizeof
(
one
))
<
0
)
{
(
char
*
)
&
one
,
sizeof
(
one
))
<
0
)
{
rfbLogPerror
(
"rfbCheckFds: setsockopt"
);
rfbLogPerror
(
"rfbCheckFds: setsockopt"
);
closesocket
(
sock
);
closesocket
(
sock
);
return
;
return
0
;
}
}
#ifdef USE_LIBWRAP
#ifdef USE_LIBWRAP
if
(
!
hosts_ctl
(
"vnc"
,
STRING_UNKNOWN
,
inet_ntoa
(
addr
.
sin_addr
),
if
(
!
hosts_ctl
(
"vnc"
,
STRING_UNKNOWN
,
inet_ntoa
(
addr
.
sin_addr
),
STRING_UNKNOWN
))
{
STRING_UNKNOWN
))
{
rfbLog
(
"Rejected connection from client %s
\n
"
,
rfbLog
(
"Rejected connection from client %s
\n
"
,
inet_ntoa
(
addr
.
sin_addr
));
inet_ntoa
(
addr
.
sin_addr
));
closesocket
(
sock
);
closesocket
(
sock
);
return
;
return
0
;
}
}
#endif
#endif
rfbLog
(
"Got connection from client %s
\n
"
,
inet_ntoa
(
addr
.
sin_addr
));
rfbLog
(
"Got connection from client %s
\n
"
,
inet_ntoa
(
addr
.
sin_addr
));
rfbNewClient
(
rfbScreen
,
sock
);
rfbNewClient
(
rfbScreen
,
sock
);
FD_CLR
(
rfbScreen
->
listenSock
,
&
fds
);
FD_CLR
(
rfbScreen
->
listenSock
,
&
fds
);
if
(
--
nfds
==
0
)
if
(
--
nfds
==
0
)
return
;
return
0
;
}
}
if
((
rfbScreen
->
udpSock
!=
-
1
)
&&
FD_ISSET
(
rfbScreen
->
udpSock
,
&
fds
))
{
if
((
rfbScreen
->
udpSock
!=
-
1
)
&&
FD_ISSET
(
rfbScreen
->
udpSock
,
&
fds
))
{
if
(
!
rfbScreen
->
udpClient
)
if
(
!
rfbScreen
->
udpClient
)
rfbNewUDPClient
(
rfbScreen
);
rfbNewUDPClient
(
rfbScreen
);
if
(
recvfrom
(
rfbScreen
->
udpSock
,
buf
,
1
,
MSG_PEEK
,
if
(
recvfrom
(
rfbScreen
->
udpSock
,
buf
,
1
,
MSG_PEEK
,
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
)
<
0
)
{
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
)
<
0
)
{
rfbLogPerror
(
"rfbCheckFds: UDP: recvfrom"
);
rfbLogPerror
(
"rfbCheckFds: UDP: recvfrom"
);
rfbDisconnectUDPSock
(
rfbScreen
);
rfbDisconnectUDPSock
(
rfbScreen
);
rfbScreen
->
udpSockConnected
=
FALSE
;
rfbScreen
->
udpSockConnected
=
FALSE
;
}
else
{
}
else
{
if
(
!
rfbScreen
->
udpSockConnected
||
if
(
!
rfbScreen
->
udpSockConnected
||
(
memcmp
(
&
addr
,
&
rfbScreen
->
udpRemoteAddr
,
addrlen
)
!=
0
))
(
memcmp
(
&
addr
,
&
rfbScreen
->
udpRemoteAddr
,
addrlen
)
!=
0
))
{
{
/* new remote end */
/* new remote end */
rfbLog
(
"rfbCheckFds: UDP: got connection
\n
"
);
rfbLog
(
"rfbCheckFds: UDP: got connection
\n
"
);
memcpy
(
&
rfbScreen
->
udpRemoteAddr
,
&
addr
,
addrlen
);
memcpy
(
&
rfbScreen
->
udpRemoteAddr
,
&
addr
,
addrlen
);
rfbScreen
->
udpSockConnected
=
TRUE
;
rfbScreen
->
udpSockConnected
=
TRUE
;
if
(
connect
(
rfbScreen
->
udpSock
,
if
(
connect
(
rfbScreen
->
udpSock
,
(
struct
sockaddr
*
)
&
addr
,
addrlen
)
<
0
)
{
(
struct
sockaddr
*
)
&
addr
,
addrlen
)
<
0
)
{
rfbLogPerror
(
"rfbCheckFds: UDP: connect"
);
rfbLogPerror
(
"rfbCheckFds: UDP: connect"
);
rfbDisconnectUDPSock
(
rfbScreen
);
rfbDisconnectUDPSock
(
rfbScreen
);
return
;
return
0
;
}
rfbNewUDPConnection
(
rfbScreen
,
rfbScreen
->
udpSock
);
}
}
rfb
NewUDPConnection
(
rfbScreen
,
rfbScreen
->
udpSock
);
rfb
ProcessUDPInput
(
rfbScreen
);
}
}
rfbProcessUDPInput
(
rfbScreen
);
FD_CLR
(
rfbScreen
->
udpSock
,
&
fds
);
if
(
--
nfds
==
0
)
return
0
;
}
}
FD_CLR
(
rfbScreen
->
udpSock
,
&
fds
);
i
=
rfbGetClientIterator
(
rfbScreen
);
if
(
--
nfds
==
0
)
while
((
cl
=
rfbClientIteratorNext
(
i
)))
{
return
;
if
(
cl
->
onHold
)
}
continue
;
if
(
FD_ISSET
(
cl
->
sock
,
&
fds
)
&&
i
=
rfbGetClientIterator
(
rfbScreen
);
FD_ISSET
(
cl
->
sock
,
&
(
rfbScreen
->
allFds
)))
while
((
cl
=
rfbClientIteratorNext
(
i
)))
{
rfbProcessClientMessage
(
cl
);
if
(
cl
->
onHold
)
}
continue
;
rfbReleaseClientIterator
(
i
);
if
(
FD_ISSET
(
cl
->
sock
,
&
fds
)
&&
FD_ISSET
(
cl
->
sock
,
&
(
rfbScreen
->
allFds
)))
}
while
(
rfbScreen
->
handleEventsEagerly
);
rfbProcessClientMessage
(
cl
);
return
1
;
}
rfbReleaseClientIterator
(
i
);
}
}
...
...
rfb/rfb.h
View file @
f52cfa65
...
@@ -310,6 +310,9 @@ typedef struct _rfbScreenInfo
...
@@ -310,6 +310,9 @@ typedef struct _rfbScreenInfo
in_addr_t
listenInterface
;
in_addr_t
listenInterface
;
int
deferPtrUpdateTime
;
int
deferPtrUpdateTime
;
/* handle as many input events as possible (default off) */
rfbBool
handleEventsEagerly
;
}
rfbScreenInfo
,
*
rfbScreenInfoPtr
;
}
rfbScreenInfo
,
*
rfbScreenInfoPtr
;
...
@@ -563,7 +566,7 @@ extern void rfbCloseClient(rfbClientPtr cl);
...
@@ -563,7 +566,7 @@ extern void rfbCloseClient(rfbClientPtr cl);
extern
int
rfbReadExact
(
rfbClientPtr
cl
,
char
*
buf
,
int
len
);
extern
int
rfbReadExact
(
rfbClientPtr
cl
,
char
*
buf
,
int
len
);
extern
int
rfbReadExactTimeout
(
rfbClientPtr
cl
,
char
*
buf
,
int
len
,
int
timeout
);
extern
int
rfbReadExactTimeout
(
rfbClientPtr
cl
,
char
*
buf
,
int
len
,
int
timeout
);
extern
int
rfbWriteExact
(
rfbClientPtr
cl
,
const
char
*
buf
,
int
len
);
extern
int
rfbWriteExact
(
rfbClientPtr
cl
,
const
char
*
buf
,
int
len
);
extern
void
rfbCheckFds
(
rfbScreenInfoPtr
rfbScreen
,
long
usec
);
extern
int
rfbCheckFds
(
rfbScreenInfoPtr
rfbScreen
,
long
usec
);
extern
int
rfbConnect
(
rfbScreenInfoPtr
rfbScreen
,
char
*
host
,
int
port
);
extern
int
rfbConnect
(
rfbScreenInfoPtr
rfbScreen
,
char
*
host
,
int
port
);
extern
int
rfbConnectToTcpAddr
(
char
*
host
,
int
port
);
extern
int
rfbConnectToTcpAddr
(
char
*
host
,
int
port
);
extern
int
rfbListenOnTCPPort
(
int
port
,
in_addr_t
iface
);
extern
int
rfbListenOnTCPPort
(
int
port
,
in_addr_t
iface
);
...
...
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