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
519a8e0e
Commit
519a8e0e
authored
Oct 10, 2001
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
copyrect corrections, fd_set in rfbNewClient, dox in rfb.h for pthreads
problem
parent
fad78817
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
11 deletions
+46
-11
CHANGES
CHANGES
+18
-3
TODO
TODO
+10
-3
main.c
main.c
+8
-0
rfb.h
rfb.h
+9
-4
rfbserver.c
rfbserver.c
+1
-1
No files found.
CHANGES
View file @
519a8e0e
0.2
rfbNewClient now sets the socket in the fd_set (for the select() call)
when compiling the library with HAVE_PTHREADS and an application
which includes "rfb.h" without, the structures got mixed up.
So, the pthreads section is now always at the end, and also
you get a linker error for rfbInitServer when using two different
pthread setups.
fixed two deadlocks: when setting a cursor and when using CopyRect
fixed CopyRect when copying modified regions (they lost the modified
property)
WIN32 target compiles and works for example :-)
fixed CopyRect (was using the wrong order of rectangles...)
should also work with pthreads, because copyrects are
always sent immediately (so that two consecutive copy rects
...
...
@@ -6,11 +16,16 @@
changed rfbUndrawCursor(rfbClientPtr) to (rfbScreenInfoPtr), because
this makes more sense!
flag backgroundLoop in rfbScreenInfo (if having pthreads)
rfbCopyRect & rfbCopyRegion (really copies rectangle in frameBuffer)
added flag to optionally not send XCursor updates.
CopyRect & CopyRegion were implemented.
if you use a rfbDoCopyR* function, it copies the data in the
framebuffer. If you prefer to do that yourself, use rfbScheduleCopyR*
instead; this doesn't modify the frameBuffer.
added flag to optionally not send XCursor updates, but only RichCursor,
or if that is not possible, fall back to server side cursor.
This is useful if your cursor has many nice colours.
fixed java viewer on server side:
SendCursorUpdate would send data even before the client pixel format
was set.
was set
, but the java applet doesn't like the server's format
.
fixed two pthread issues:
rfbSendFramebuffer was sent by a ProcessClientMessage function
(unprotected by updateMutex).
...
...
TODO
View file @
519a8e0e
immediate:
----------
test copyRect and pthreads.
authentification schemes (secure vnc)
udp
udp
(need an rfbClientPtr udpClient in rfbScreen)
documentation
hint that to mark very tiny regions as
modified is possibly inefficient for the encodings.
(a trail of points could be
better
a small rectangle).
(a trail of points could be
tter be
a small rectangle).
later:
------
autoconf? at least Sun Solaris and Windows compilation
(maybe Michael makes that)
using Hermes library for fast colour translations.
CORBA
done:
-----
.test copyRect and pthreads.
.optionally dont draw rich cursors as xcursors
.cursor smears on IRIX with pthreads, then has bus error. has to be a mutex
problem in cursor routines.
...
...
@@ -56,3 +58,8 @@ fix bug with odd width (depends on client depth: width has to be multiple of ser
three have to be warned that this is happening.
-> rfbClientConnectionGone can only be called by the outer loop
(with background loop, it is input, else it is processEvents).
. fixed pthreads issues:
cursor deadlock,
CopyRect deadlock.
. when copying a region with modified parts, they were not marked
as modified
main.c
View file @
519a8e0e
...
...
@@ -75,6 +75,7 @@ void rfbScheduleCopyRegion(rfbScreenInfoPtr rfbScreen,sraRegionPtr copyRegion,in
while
((
cl
=
rfbClientIteratorNext
(
iterator
)))
{
LOCK
(
cl
->
updateMutex
);
if
(
cl
->
useCopyRect
)
{
sraRegionPtr
modifiedRegionBackup
;
if
(
!
sraRgnEmpty
(
cl
->
copyRegion
)
&&
(
cl
->
copyDX
!=
dx
||
cl
->
copyDY
!=
dy
))
{
sraRgnOr
(
cl
->
copyRegion
,
cl
->
modifiedRegion
);
sraRgnMakeEmpty
(
cl
->
copyRegion
);
...
...
@@ -83,6 +84,13 @@ void rfbScheduleCopyRegion(rfbScreenInfoPtr rfbScreen,sraRegionPtr copyRegion,in
cl
->
copyDX
=
dx
;
cl
->
copyDY
=
dy
;
/* if there were modified regions, which are now copied: */
modifiedRegionBackup
=
sraRgnCreateRgn
(
cl
->
modifiedRegion
);
sraRgnOffset
(
modifiedRegionBackup
,
dx
,
dy
);
sraRgnAnd
(
modifiedRegionBackup
,
cl
->
copyRegion
);
sraRgnOr
(
cl
->
modifiedRegion
,
modifiedRegionBackup
);
sraRgnDestroy
(
modifiedRegionBackup
);
/* while(!sraRgnEmpty(cl->copyRegion)) */
{
#ifdef HAVE_PTHREADS
if
(
!
cl
->
screen
->
backgroundLoop
)
...
...
rfb.h
View file @
519a8e0e
...
...
@@ -738,15 +738,20 @@ void rfbMarkRectAsModified(rfbScreenInfoPtr rfbScreen,int x1,int y1,int x2,int y
void
rfbMarkRegionAsModified
(
rfbScreenInfoPtr
rfbScreen
,
sraRegionPtr
modRegion
);
void
doNothingWithClient
(
rfbClientPtr
cl
);
/*
functions to make a vnc server */
extern
rfbScreenInfoPtr
rfbGetScreen
(
int
argc
,
char
**
argv
,
int
width
,
int
height
,
int
bitsPerSample
,
int
samplesPerPixel
,
int
bytesPerPixel
);
/*
if you use pthreads, but don't define HAVE_PTHREADS, the structs
get all mixed up. So this gives a linker error reminding you to compile
the library and your application (at least the parts including rfb.h)
with the same support for pthreads. */
#ifdef HAVE_PTHREADS
#define rfbInitServer rfbInitServerWithPthreads
#else
#define rfbInitServer rfbInitServerWithoutPthreads
#endif
/* functions to make a vnc server */
extern
rfbScreenInfoPtr
rfbGetScreen
(
int
argc
,
char
**
argv
,
int
width
,
int
height
,
int
bitsPerSample
,
int
samplesPerPixel
,
int
bytesPerPixel
);
extern
void
rfbInitServer
(
rfbScreenInfoPtr
rfbScreen
);
extern
void
rfbScreenCleanup
(
rfbScreenInfoPtr
screenInfo
);
...
...
rfbserver.c
View file @
519a8e0e
...
...
@@ -137,7 +137,6 @@ rfbNewClientConnection(rfbScreen,sock)
if
(
cl
!=
NULL
)
newConnection
(
cl
,
(
KEYBOARD_DEVICE
|
POINTER_DEVICE
),
1
,
1
,
1
);
#endif
FD_SET
(
sock
,
&
(
rfbScreen
->
allFds
));
}
...
...
@@ -194,6 +193,7 @@ rfbNewClient(rfbScreen,sock)
cl
=
(
rfbClientPtr
)
xalloc
(
sizeof
(
rfbClientRec
));
FD_SET
(
sock
,
&
(
rfbScreen
->
allFds
));
cl
->
screen
=
rfbScreen
;
cl
->
sock
=
sock
;
getpeername
(
sock
,
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
);
...
...
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