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
4fcb6087
Commit
4fcb6087
authored
Aug 06, 2003
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rfbErr introduced
parent
79c414ab
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
46 additions
and
44 deletions
+46
-44
ChangeLog
ChangeLog
+1
-0
auth.c
auth.c
+1
-1
x11vnc.c
contrib/x11vnc.c
+4
-4
fontsel.c
examples/fontsel.c
+1
-1
mac.c
examples/mac.c
+1
-1
httpd.c
httpd.c
+10
-10
main.c
main.c
+8
-7
rfb.h
rfb/rfb.h
+1
-1
rfbregion.c
rfbregion.c
+1
-1
rfbserver.c
rfbserver.c
+6
-6
rre.c
rre.c
+1
-1
sockets.c
sockets.c
+1
-1
translate.c
translate.c
+4
-4
LinuxVNC.c
vncterm/LinuxVNC.c
+4
-4
VNCommand.c
vncterm/VNCommand.c
+1
-1
zlib.c
zlib.c
+1
-1
No files found.
ChangeLog
View file @
4fcb6087
introduce rfbErr for Errors (Erik)
make rfbLog overridable (suggested by Erik)
make rfbLog overridable (suggested by Erik)
don't reutrn on EINTR in WriteExact()/ReadExact() (suggested by Erik)
don't reutrn on EINTR in WriteExact()/ReadExact() (suggested by Erik)
use AX_PREFIX_CONFIG_H to prefix constants in config.h to avoid
use AX_PREFIX_CONFIG_H to prefix constants in config.h to avoid
...
...
auth.c
View file @
4fcb6087
...
@@ -83,7 +83,7 @@ rfbAuthProcessClientMessage(cl)
...
@@ -83,7 +83,7 @@ rfbAuthProcessClientMessage(cl)
}
}
if
(
!
cl
->
screen
->
passwordCheck
(
cl
,(
const
char
*
)
response
,
CHALLENGESIZE
))
{
if
(
!
cl
->
screen
->
passwordCheck
(
cl
,(
const
char
*
)
response
,
CHALLENGESIZE
))
{
rfb
Log
(
"rfbAuthProcessClientMessage: password check failed
\n
"
);
rfb
Err
(
"rfbAuthProcessClientMessage: password check failed
\n
"
);
authResult
=
Swap32IfLE
(
rfbVncAuthFailed
);
authResult
=
Swap32IfLE
(
rfbVncAuthFailed
);
if
(
WriteExact
(
cl
,
(
char
*
)
&
authResult
,
4
)
<
0
)
{
if
(
WriteExact
(
cl
,
(
char
*
)
&
authResult
,
4
)
<
0
)
{
rfbLogPerror
(
"rfbAuthProcessClientMessage: write"
);
rfbLogPerror
(
"rfbAuthProcessClientMessage: write"
);
...
...
contrib/x11vnc.c
View file @
4fcb6087
...
@@ -1135,7 +1135,7 @@ void shm_create(XShmSegmentInfo *shm, XImage **ximg_ptr, int w, int h,
...
@@ -1135,7 +1135,7 @@ void shm_create(XShmSegmentInfo *shm, XImage **ximg_ptr, int w, int h,
xim
=
XShmCreateImage
(
dpy
,
visual
,
bpp
,
ZPixmap
,
NULL
,
shm
,
w
,
h
);
xim
=
XShmCreateImage
(
dpy
,
visual
,
bpp
,
ZPixmap
,
NULL
,
shm
,
w
,
h
);
if
(
xim
==
NULL
)
{
if
(
xim
==
NULL
)
{
rfb
Log
(
"XShmCreateImage(%s) failed.
\n
"
,
name
);
rfb
Err
(
"XShmCreateImage(%s) failed.
\n
"
,
name
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -1145,7 +1145,7 @@ void shm_create(XShmSegmentInfo *shm, XImage **ximg_ptr, int w, int h,
...
@@ -1145,7 +1145,7 @@ void shm_create(XShmSegmentInfo *shm, XImage **ximg_ptr, int w, int h,
xim
->
bytes_per_line
*
xim
->
height
,
IPC_CREAT
|
0777
);
xim
->
bytes_per_line
*
xim
->
height
,
IPC_CREAT
|
0777
);
if
(
shm
->
shmid
==
-
1
)
{
if
(
shm
->
shmid
==
-
1
)
{
rfb
Log
(
"shmget(%s) failed.
\n
"
,
name
);
rfb
Err
(
"shmget(%s) failed.
\n
"
,
name
);
perror
(
"shmget"
);
perror
(
"shmget"
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -1153,7 +1153,7 @@ void shm_create(XShmSegmentInfo *shm, XImage **ximg_ptr, int w, int h,
...
@@ -1153,7 +1153,7 @@ void shm_create(XShmSegmentInfo *shm, XImage **ximg_ptr, int w, int h,
shm
->
shmaddr
=
xim
->
data
=
(
char
*
)
shmat
(
shm
->
shmid
,
0
,
0
);
shm
->
shmaddr
=
xim
->
data
=
(
char
*
)
shmat
(
shm
->
shmid
,
0
,
0
);
if
(
shm
->
shmaddr
==
(
char
*
)
-
1
)
{
if
(
shm
->
shmaddr
==
(
char
*
)
-
1
)
{
rfb
Log
(
"shmat(%s) failed.
\n
"
,
name
);
rfb
Err
(
"shmat(%s) failed.
\n
"
,
name
);
perror
(
"shmat"
);
perror
(
"shmat"
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -1161,7 +1161,7 @@ void shm_create(XShmSegmentInfo *shm, XImage **ximg_ptr, int w, int h,
...
@@ -1161,7 +1161,7 @@ void shm_create(XShmSegmentInfo *shm, XImage **ximg_ptr, int w, int h,
shm
->
readOnly
=
False
;
shm
->
readOnly
=
False
;
if
(
!
XShmAttach
(
dpy
,
shm
))
{
if
(
!
XShmAttach
(
dpy
,
shm
))
{
rfb
Log
(
"XShmAttach(%s) failed.
\n
"
,
name
);
rfb
Err
(
"XShmAttach(%s) failed.
\n
"
,
name
);
exit
(
1
);
exit
(
1
);
}
}
...
...
examples/fontsel.c
View file @
4fcb6087
...
@@ -54,7 +54,7 @@ int main(int argc,char** argv)
...
@@ -54,7 +54,7 @@ int main(int argc,char** argv)
rfbScreen
=
s
;
rfbScreen
=
s
;
font
=
rfbLoadConsoleFont
(
DEFAULTFONT
);
font
=
rfbLoadConsoleFont
(
DEFAULTFONT
);
if
(
!
font
)
{
if
(
!
font
)
{
rfb
Log
(
"Couldn't find %s
\n
"
,
DEFAULTFONT
);
rfb
Err
(
"Couldn't find %s
\n
"
,
DEFAULTFONT
);
exit
(
1
);
exit
(
1
);
}
}
...
...
examples/mac.c
View file @
4fcb6087
...
@@ -410,7 +410,7 @@ KbdAddEvent(rfbBool down, rfbKeySym keySym, struct _rfbClientRec* cl)
...
@@ -410,7 +410,7 @@ KbdAddEvent(rfbBool down, rfbKeySym keySym, struct _rfbClientRec* cl)
}
}
if
(
!
found
)
{
if
(
!
found
)
{
rfb
Log
(
"warning: couldn't figure out keycode for X keysym %d (0x%x)
\n
"
,
rfb
Err
(
"warning: couldn't figure out keycode for X keysym %d (0x%x)
\n
"
,
(
int
)
keySym
,
(
int
)
keySym
);
(
int
)
keySym
,
(
int
)
keySym
);
}
else
{
}
else
{
/* Hopefully I can get away with not specifying a CGCharCode.
/* Hopefully I can get away with not specifying a CGCharCode.
...
...
httpd.c
View file @
4fcb6087
...
@@ -223,7 +223,7 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
...
@@ -223,7 +223,7 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
cl
.
sock
=
rfbScreen
->
httpSock
;
cl
.
sock
=
rfbScreen
->
httpSock
;
if
(
strlen
(
rfbScreen
->
httpDir
)
>
255
)
{
if
(
strlen
(
rfbScreen
->
httpDir
)
>
255
)
{
rfb
Log
(
"-httpd directory too long
\n
"
);
rfb
Err
(
"-httpd directory too long
\n
"
);
httpCloseSock
(
rfbScreen
);
httpCloseSock
(
rfbScreen
);
return
;
return
;
}
}
...
@@ -238,7 +238,7 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
...
@@ -238,7 +238,7 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
ssize_t
got
;
ssize_t
got
;
if
(
buf_filled
>
sizeof
(
buf
))
{
if
(
buf_filled
>
sizeof
(
buf
))
{
rfb
Log
(
"httpProcessInput: HTTP request is too long
\n
"
);
rfb
Err
(
"httpProcessInput: HTTP request is too long
\n
"
);
httpCloseSock
(
rfbScreen
);
httpCloseSock
(
rfbScreen
);
return
;
return
;
}
}
...
@@ -248,7 +248,7 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
...
@@ -248,7 +248,7 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
if
(
got
<=
0
)
{
if
(
got
<=
0
)
{
if
(
got
==
0
)
{
if
(
got
==
0
)
{
rfb
Log
(
"httpd: premature connection close
\n
"
);
rfb
Err
(
"httpd: premature connection close
\n
"
);
}
else
{
}
else
{
if
(
errno
==
EAGAIN
)
{
if
(
errno
==
EAGAIN
)
{
return
;
return
;
...
@@ -274,7 +274,7 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
...
@@ -274,7 +274,7 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
const
static
char
*
PROXY_OK_STR
=
"HTTP/1.0 200 OK
\r\n
Content-Type: octet-stream
\r\n
Pragma: no-cache
\r\n\r\n
"
;
const
static
char
*
PROXY_OK_STR
=
"HTTP/1.0 200 OK
\r\n
Content-Type: octet-stream
\r\n
Pragma: no-cache
\r\n\r\n
"
;
if
(
!
strncmp
(
buf
,
"CONNECT "
,
8
))
{
if
(
!
strncmp
(
buf
,
"CONNECT "
,
8
))
{
if
(
atoi
(
strchr
(
buf
,
':'
)
+
1
)
!=
rfbScreen
->
rfbPort
)
{
if
(
atoi
(
strchr
(
buf
,
':'
)
+
1
)
!=
rfbScreen
->
rfbPort
)
{
rfb
Log
(
"httpd: CONNECT format invalid.
\n
"
);
rfb
Err
(
"httpd: CONNECT format invalid.
\n
"
);
WriteExact
(
&
cl
,
INVALID_REQUEST_STR
,
strlen
(
INVALID_REQUEST_STR
));
WriteExact
(
&
cl
,
INVALID_REQUEST_STR
,
strlen
(
INVALID_REQUEST_STR
));
httpCloseSock
(
rfbScreen
);
httpCloseSock
(
rfbScreen
);
return
;
return
;
...
@@ -297,7 +297,7 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
...
@@ -297,7 +297,7 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
}
}
if
(
strncmp
(
buf
,
"GET "
,
4
))
{
if
(
strncmp
(
buf
,
"GET "
,
4
))
{
rfb
Log
(
"httpd: no GET line
\n
"
);
rfb
Err
(
"httpd: no GET line
\n
"
);
httpCloseSock
(
rfbScreen
);
httpCloseSock
(
rfbScreen
);
return
;
return
;
}
else
{
}
else
{
...
@@ -306,26 +306,26 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
...
@@ -306,26 +306,26 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
}
}
if
(
strlen
(
buf
)
>
maxFnameLen
)
{
if
(
strlen
(
buf
)
>
maxFnameLen
)
{
rfb
Log
(
"httpd: GET line too long
\n
"
);
rfb
Err
(
"httpd: GET line too long
\n
"
);
httpCloseSock
(
rfbScreen
);
httpCloseSock
(
rfbScreen
);
return
;
return
;
}
}
if
(
sscanf
(
buf
,
"GET %s HTTP/1.0"
,
fname
)
!=
1
)
{
if
(
sscanf
(
buf
,
"GET %s HTTP/1.0"
,
fname
)
!=
1
)
{
rfb
Log
(
"httpd: couldn't parse GET line
\n
"
);
rfb
Err
(
"httpd: couldn't parse GET line
\n
"
);
httpCloseSock
(
rfbScreen
);
httpCloseSock
(
rfbScreen
);
return
;
return
;
}
}
if
(
fname
[
0
]
!=
'/'
)
{
if
(
fname
[
0
]
!=
'/'
)
{
rfb
Log
(
"httpd: filename didn't begin with '/'
\n
"
);
rfb
Err
(
"httpd: filename didn't begin with '/'
\n
"
);
WriteExact
(
&
cl
,
NOT_FOUND_STR
,
strlen
(
NOT_FOUND_STR
));
WriteExact
(
&
cl
,
NOT_FOUND_STR
,
strlen
(
NOT_FOUND_STR
));
httpCloseSock
(
rfbScreen
);
httpCloseSock
(
rfbScreen
);
return
;
return
;
}
}
if
(
strchr
(
fname
+
1
,
'/'
)
!=
NULL
)
{
if
(
strchr
(
fname
+
1
,
'/'
)
!=
NULL
)
{
rfb
Log
(
"httpd: asking for file in other directory
\n
"
);
rfb
Err
(
"httpd: asking for file in other directory
\n
"
);
WriteExact
(
&
cl
,
NOT_FOUND_STR
,
strlen
(
NOT_FOUND_STR
));
WriteExact
(
&
cl
,
NOT_FOUND_STR
,
strlen
(
NOT_FOUND_STR
));
httpCloseSock
(
rfbScreen
);
httpCloseSock
(
rfbScreen
);
return
;
return
;
...
@@ -343,7 +343,7 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
...
@@ -343,7 +343,7 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
*
ptr
=
'\0'
;
*
ptr
=
'\0'
;
if
(
!
parseParams
(
&
ptr
[
1
],
params
,
1024
))
{
if
(
!
parseParams
(
&
ptr
[
1
],
params
,
1024
))
{
params
[
0
]
=
'\0'
;
params
[
0
]
=
'\0'
;
rfb
Log
(
"httpd: bad parameters in the URL
\n
"
);
rfb
Err
(
"httpd: bad parameters in the URL
\n
"
);
}
}
}
}
...
...
main.c
View file @
4fcb6087
...
@@ -83,10 +83,11 @@ rfbDefaultLog(const char *format, ...)
...
@@ -83,10 +83,11 @@ rfbDefaultLog(const char *format, ...)
}
}
rfbLogProc
rfbLog
=
rfbDefaultLog
;
rfbLogProc
rfbLog
=
rfbDefaultLog
;
rfbLogProc
rfbErr
=
rfbDefaultLog
;
void
rfbLogPerror
(
const
char
*
str
)
void
rfbLogPerror
(
const
char
*
str
)
{
{
rfb
Log
(
"%s: %s
\n
"
,
str
,
strerror
(
errno
));
rfb
Err
(
"%s: %s
\n
"
,
str
,
strerror
(
errno
));
}
}
void
rfbScheduleCopyRegion
(
rfbScreenInfoPtr
rfbScreen
,
sraRegionPtr
copyRegion
,
int
dx
,
int
dy
)
void
rfbScheduleCopyRegion
(
rfbScreenInfoPtr
rfbScreen
,
sraRegionPtr
copyRegion
,
int
dx
,
int
dy
)
...
@@ -442,7 +443,7 @@ rfbBool defaultPasswordCheck(rfbClientPtr cl,const char* response,int len)
...
@@ -442,7 +443,7 @@ rfbBool defaultPasswordCheck(rfbClientPtr cl,const char* response,int len)
char
*
passwd
=
vncDecryptPasswdFromFile
(
cl
->
screen
->
rfbAuthPasswdData
);
char
*
passwd
=
vncDecryptPasswdFromFile
(
cl
->
screen
->
rfbAuthPasswdData
);
if
(
!
passwd
)
{
if
(
!
passwd
)
{
rfb
Log
(
"Couldn't read password file: %s
\n
"
,
cl
->
screen
->
rfbAuthPasswdData
);
rfb
Err
(
"Couldn't read password file: %s
\n
"
,
cl
->
screen
->
rfbAuthPasswdData
);
return
(
FALSE
);
return
(
FALSE
);
}
}
...
@@ -456,7 +457,7 @@ rfbBool defaultPasswordCheck(rfbClientPtr cl,const char* response,int len)
...
@@ -456,7 +457,7 @@ rfbBool defaultPasswordCheck(rfbClientPtr cl,const char* response,int len)
free
(
passwd
);
free
(
passwd
);
if
(
memcmp
(
cl
->
authChallenge
,
response
,
len
)
!=
0
)
{
if
(
memcmp
(
cl
->
authChallenge
,
response
,
len
)
!=
0
)
{
rfb
Log
(
"rfbAuthProcessClientMessage: authentication failed from %s
\n
"
,
rfb
Err
(
"rfbAuthProcessClientMessage: authentication failed from %s
\n
"
,
cl
->
host
);
cl
->
host
);
return
(
FALSE
);
return
(
FALSE
);
}
}
...
@@ -481,7 +482,7 @@ rfbBool rfbCheckPasswordByList(rfbClientPtr cl,const char* response,int len)
...
@@ -481,7 +482,7 @@ rfbBool rfbCheckPasswordByList(rfbClientPtr cl,const char* response,int len)
}
}
}
}
rfb
Log
(
"rfbAuthProcessClientMessage: authentication failed from %s
\n
"
,
rfb
Err
(
"rfbAuthProcessClientMessage: authentication failed from %s
\n
"
,
cl
->
host
);
cl
->
host
);
return
(
FALSE
);
return
(
FALSE
);
}
}
...
@@ -550,7 +551,7 @@ rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv,
...
@@ -550,7 +551,7 @@ rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv,
INIT_MUTEX
(
logMutex
);
INIT_MUTEX
(
logMutex
);
if
(
width
&
3
)
if
(
width
&
3
)
rfb
Log
(
"WARNING: Width (%d) is not a multiple of 4. VncViewer has problems with that.
\n
"
,
width
);
rfb
Err
(
"WARNING: Width (%d) is not a multiple of 4. VncViewer has problems with that.
\n
"
,
width
);
rfbScreen
->
autoPort
=
FALSE
;
rfbScreen
->
autoPort
=
FALSE
;
rfbScreen
->
rfbClientHead
=
0
;
rfbScreen
->
rfbClientHead
=
0
;
...
@@ -667,7 +668,7 @@ void rfbNewFramebuffer(rfbScreenInfoPtr rfbScreen, char *framebuffer,
...
@@ -667,7 +668,7 @@ void rfbNewFramebuffer(rfbScreenInfoPtr rfbScreen, char *framebuffer,
old_format
=
rfbScreen
->
rfbServerFormat
;
old_format
=
rfbScreen
->
rfbServerFormat
;
if
(
width
&
3
)
if
(
width
&
3
)
rfb
Log
(
"WARNING: New width (%d) is not a multiple of 4.
\n
"
,
width
);
rfb
Err
(
"WARNING: New width (%d) is not a multiple of 4.
\n
"
,
width
);
rfbScreen
->
width
=
width
;
rfbScreen
->
width
=
width
;
rfbScreen
->
height
=
height
;
rfbScreen
->
height
=
height
;
...
@@ -826,7 +827,7 @@ void rfbRunEventLoop(rfbScreenInfoPtr rfbScreen, long usec, rfbBool runInBackgro
...
@@ -826,7 +827,7 @@ void rfbRunEventLoop(rfbScreenInfoPtr rfbScreen, long usec, rfbBool runInBackgro
pthread_create
(
&
listener_thread
,
NULL
,
listenerRun
,
rfbScreen
);
pthread_create
(
&
listener_thread
,
NULL
,
listenerRun
,
rfbScreen
);
return
;
return
;
#else
#else
rfb
Log
(
"Can't run in background, because I don't have PThreads!
\n
"
);
rfb
Err
(
"Can't run in background, because I don't have PThreads!
\n
"
);
return
;
return
;
#endif
#endif
}
}
...
...
rfb/rfb.h
View file @
4fcb6087
...
@@ -730,7 +730,7 @@ extern rfbBool rfbProcessSizeArguments(int* width,int* height,int* bpp,int* argc
...
@@ -730,7 +730,7 @@ extern rfbBool rfbProcessSizeArguments(int* width,int* height,int* bpp,int* argc
extern
void
rfbLogEnable
(
int
enabled
);
extern
void
rfbLogEnable
(
int
enabled
);
typedef
void
(
*
rfbLogProc
)(
const
char
*
format
,
...);
typedef
void
(
*
rfbLogProc
)(
const
char
*
format
,
...);
extern
rfbLogProc
rfbLog
;
extern
rfbLogProc
rfbLog
,
rfbErr
;
extern
void
rfbLogPerror
(
const
char
*
str
);
extern
void
rfbLogPerror
(
const
char
*
str
);
void
rfbScheduleCopyRect
(
rfbScreenInfoPtr
rfbScreen
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
dx
,
int
dy
);
void
rfbScheduleCopyRect
(
rfbScreenInfoPtr
rfbScreen
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
dx
,
int
dy
);
...
...
rfbregion.c
View file @
4fcb6087
...
@@ -759,7 +759,7 @@ rfbBool sraRgnIteratorNext(sraRectangleIterator* i,sraRect* r)
...
@@ -759,7 +759,7 @@ rfbBool sraRgnIteratorNext(sraRectangleIterator* i,sraRect* r)
}
}
if
((
i
->
ptrPos
%
4
)
!=
2
)
{
if
((
i
->
ptrPos
%
4
)
!=
2
)
{
rfb
Log
(
"sraRgnIteratorNext: offset is wrong (%d%%4!=2)
\n
"
,
i
->
ptrPos
);
rfb
Err
(
"sraRgnIteratorNext: offset is wrong (%d%%4!=2)
\n
"
,
i
->
ptrPos
);
return
FALSE
;
return
FALSE
;
}
}
...
...
rfbserver.c
View file @
4fcb6087
...
@@ -521,7 +521,7 @@ rfbProcessClientProtocolVersion(cl)
...
@@ -521,7 +521,7 @@ rfbProcessClientProtocolVersion(cl)
if
(
sscanf
(
pv
,
rfbProtocolVersionFormat
,
&
major_
,
&
minor_
)
!=
2
)
{
if
(
sscanf
(
pv
,
rfbProtocolVersionFormat
,
&
major_
,
&
minor_
)
!=
2
)
{
char
name
[
1024
];
char
name
[
1024
];
if
(
sscanf
(
pv
,
"RFB %03d.%03d %1024s
\n
"
,
&
major_
,
&
minor_
,
name
)
!=
3
)
{
if
(
sscanf
(
pv
,
"RFB %03d.%03d %1024s
\n
"
,
&
major_
,
&
minor_
,
name
)
!=
3
)
{
rfb
Log
(
"rfbProcessClientProtocolVersion: not a valid RFB client
\n
"
);
rfb
Err
(
"rfbProcessClientProtocolVersion: not a valid RFB client
\n
"
);
rfbCloseClient
(
cl
);
rfbCloseClient
(
cl
);
return
;
return
;
}
}
...
@@ -533,7 +533,7 @@ rfbProcessClientProtocolVersion(cl)
...
@@ -533,7 +533,7 @@ rfbProcessClientProtocolVersion(cl)
if
(
major_
!=
rfbProtocolMajorVersion
)
{
if
(
major_
!=
rfbProtocolMajorVersion
)
{
/* Major version mismatch - send a ConnFailed message */
/* Major version mismatch - send a ConnFailed message */
rfb
Log
(
"Major version mismatch
\n
"
);
rfb
Err
(
"Major version mismatch
\n
"
);
sprintf
(
failureReason
,
sprintf
(
failureReason
,
"RFB protocol version mismatch - server %d.%d, client %d.%d"
,
"RFB protocol version mismatch - server %d.%d, client %d.%d"
,
rfbProtocolMajorVersion
,
rfbProtocolMinorVersion
,
major_
,
minor_
);
rfbProtocolMajorVersion
,
rfbProtocolMinorVersion
,
major_
,
minor_
);
...
@@ -1448,7 +1448,7 @@ rfbSendRectEncodingRaw(cl, x, y, w, h)
...
@@ -1448,7 +1448,7 @@ rfbSendRectEncodingRaw(cl, x, y, w, h)
nlines
=
(
UPDATE_BUF_SIZE
-
cl
->
ublen
)
/
bytesPerLine
;
nlines
=
(
UPDATE_BUF_SIZE
-
cl
->
ublen
)
/
bytesPerLine
;
if
(
nlines
==
0
)
{
if
(
nlines
==
0
)
{
rfb
Log
(
"rfbSendRectEncodingRaw: send buffer too small for %d "
rfb
Err
(
"rfbSendRectEncodingRaw: send buffer too small for %d "
"bytes per line
\n
"
,
bytesPerLine
);
"bytes per line
\n
"
,
bytesPerLine
);
rfbCloseClient
(
cl
);
rfbCloseClient
(
cl
);
return
FALSE
;
return
FALSE
;
...
@@ -1698,7 +1698,7 @@ rfbProcessUDPInput(rfbScreenInfoPtr rfbScreen)
...
@@ -1698,7 +1698,7 @@ rfbProcessUDPInput(rfbScreenInfoPtr rfbScreen)
case
rfbKeyEvent
:
case
rfbKeyEvent
:
if
(
n
!=
sz_rfbKeyEventMsg
)
{
if
(
n
!=
sz_rfbKeyEventMsg
)
{
rfb
Log
(
"rfbProcessUDPInput: key event incorrect length
\n
"
);
rfb
Err
(
"rfbProcessUDPInput: key event incorrect length
\n
"
);
rfbDisconnectUDPSock
(
rfbScreen
);
rfbDisconnectUDPSock
(
rfbScreen
);
return
;
return
;
}
}
...
@@ -1707,7 +1707,7 @@ rfbProcessUDPInput(rfbScreenInfoPtr rfbScreen)
...
@@ -1707,7 +1707,7 @@ rfbProcessUDPInput(rfbScreenInfoPtr rfbScreen)
case
rfbPointerEvent
:
case
rfbPointerEvent
:
if
(
n
!=
sz_rfbPointerEventMsg
)
{
if
(
n
!=
sz_rfbPointerEventMsg
)
{
rfb
Log
(
"rfbProcessUDPInput: ptr event incorrect length
\n
"
);
rfb
Err
(
"rfbProcessUDPInput: ptr event incorrect length
\n
"
);
rfbDisconnectUDPSock
(
rfbScreen
);
rfbDisconnectUDPSock
(
rfbScreen
);
return
;
return
;
}
}
...
@@ -1716,7 +1716,7 @@ rfbProcessUDPInput(rfbScreenInfoPtr rfbScreen)
...
@@ -1716,7 +1716,7 @@ rfbProcessUDPInput(rfbScreenInfoPtr rfbScreen)
break
;
break
;
default
:
default
:
rfb
Log
(
"rfbProcessUDPInput: unknown message type %d
\n
"
,
rfb
Err
(
"rfbProcessUDPInput: unknown message type %d
\n
"
,
msg
.
type
);
msg
.
type
);
rfbDisconnectUDPSock
(
rfbScreen
);
rfbDisconnectUDPSock
(
rfbScreen
);
}
}
...
...
rre.c
View file @
4fcb6087
...
@@ -307,7 +307,7 @@ getBgColour(data,size,bpp)
...
@@ -307,7 +307,7 @@ getBgColour(data,size,bpp)
for
(
j
=
0
;
j
<
size
;
j
++
)
{
for
(
j
=
0
;
j
<
size
;
j
++
)
{
k
=
(
int
)(((
uint8_t
*
)
data
)[
j
]);
k
=
(
int
)(((
uint8_t
*
)
data
)[
j
]);
if
(
k
>=
NUMCLRS
)
{
if
(
k
>=
NUMCLRS
)
{
rfb
Log
(
"getBgColour: unusual colour = %d
\n
"
,
k
);
rfb
Err
(
"getBgColour: unusual colour = %d
\n
"
,
k
);
return
0
;
return
0
;
}
}
counts
[
k
]
+=
1
;
counts
[
k
]
+=
1
;
...
...
sockets.c
View file @
4fcb6087
...
@@ -474,7 +474,7 @@ WriteExact(cl, buf, len)
...
@@ -474,7 +474,7 @@ WriteExact(cl, buf, len)
}
else
if
(
n
==
0
)
{
}
else
if
(
n
==
0
)
{
rfb
Log
(
"WriteExact: write returned 0?
\n
"
);
rfb
Err
(
"WriteExact: write returned 0?
\n
"
);
return
0
;
return
0
;
}
else
{
}
else
{
...
...
translate.c
View file @
4fcb6087
...
@@ -259,7 +259,7 @@ rfbSetTranslateFunction(cl)
...
@@ -259,7 +259,7 @@ rfbSetTranslateFunction(cl)
#endif
#endif
(
cl
->
screen
->
rfbServerFormat
.
bitsPerPixel
!=
32
))
(
cl
->
screen
->
rfbServerFormat
.
bitsPerPixel
!=
32
))
{
{
rfb
Log
(
"%s: server bits per pixel not 8, 16 or 32 (is %d)
\n
"
,
rfb
Err
(
"%s: server bits per pixel not 8, 16 or 32 (is %d)
\n
"
,
"rfbSetTranslateFunction"
,
"rfbSetTranslateFunction"
,
cl
->
screen
->
rfbServerFormat
.
bitsPerPixel
);
cl
->
screen
->
rfbServerFormat
.
bitsPerPixel
);
rfbCloseClient
(
cl
);
rfbCloseClient
(
cl
);
...
@@ -273,14 +273,14 @@ rfbSetTranslateFunction(cl)
...
@@ -273,14 +273,14 @@ rfbSetTranslateFunction(cl)
#endif
#endif
(
cl
->
format
.
bitsPerPixel
!=
32
))
(
cl
->
format
.
bitsPerPixel
!=
32
))
{
{
rfb
Log
(
"%s: client bits per pixel not 8, 16 or 32
\n
"
,
rfb
Err
(
"%s: client bits per pixel not 8, 16 or 32
\n
"
,
"rfbSetTranslateFunction"
);
"rfbSetTranslateFunction"
);
rfbCloseClient
(
cl
);
rfbCloseClient
(
cl
);
return
FALSE
;
return
FALSE
;
}
}
if
(
!
cl
->
format
.
trueColour
&&
(
cl
->
format
.
bitsPerPixel
!=
8
))
{
if
(
!
cl
->
format
.
trueColour
&&
(
cl
->
format
.
bitsPerPixel
!=
8
))
{
rfb
Log
(
"rfbSetTranslateFunction: client has colour map "
rfb
Err
(
"rfbSetTranslateFunction: client has colour map "
"but %d-bit - can only cope with 8-bit colour maps
\n
"
,
"but %d-bit - can only cope with 8-bit colour maps
\n
"
,
cl
->
format
.
bitsPerPixel
);
cl
->
format
.
bitsPerPixel
);
rfbCloseClient
(
cl
);
rfbCloseClient
(
cl
);
...
@@ -369,7 +369,7 @@ rfbSetClientColourMapBGR233(cl)
...
@@ -369,7 +369,7 @@ rfbSetClientColourMapBGR233(cl)
int
r
,
g
,
b
;
int
r
,
g
,
b
;
if
(
cl
->
format
.
bitsPerPixel
!=
8
)
{
if
(
cl
->
format
.
bitsPerPixel
!=
8
)
{
rfb
Log
(
"%s: client not 8 bits per pixel
\n
"
,
rfb
Err
(
"%s: client not 8 bits per pixel
\n
"
,
"rfbSetClientColourMapBGR233"
);
"rfbSetClientColourMapBGR233"
);
rfbCloseClient
(
cl
);
rfbCloseClient
(
cl
);
return
FALSE
;
return
FALSE
;
...
...
vncterm/LinuxVNC.c
View file @
4fcb6087
...
@@ -57,7 +57,7 @@ void do_key(rfbBool down,rfbKeySym keySym,rfbClientPtr cl)
...
@@ -57,7 +57,7 @@ void do_key(rfbBool down,rfbKeySym keySym,rfbClientPtr cl)
tty_inject_device
=
open
(
device
,
O_WRONLY
);
tty_inject_device
=
open
(
device
,
O_WRONLY
);
ret
=
ioctl
(
tty_inject_device
,
TIOCSTI
,
&
keySym
);
ret
=
ioctl
(
tty_inject_device
,
TIOCSTI
,
&
keySym
);
if
(
ret
<
0
)
if
(
ret
<
0
)
rfb
Log
(
"Couldn't reopen device %s!
\n
"
,
device
);
rfb
Err
(
"Couldn't reopen device %s!
\n
"
,
device
);
}
}
}
}
}
}
...
@@ -88,7 +88,7 @@ int main(int argc,char **argv)
...
@@ -88,7 +88,7 @@ int main(int argc,char **argv)
if
(
argc
>
1
)
{
if
(
argc
>
1
)
{
if
((
tty
=
atoi
(
argv
[
1
]))
<
1
)
{
if
((
tty
=
atoi
(
argv
[
1
]))
<
1
)
{
rfb
Log
(
"Usage: %s [tty_number [vnc args]]
\n
"
,
argv
[
0
]);
rfb
Err
(
"Usage: %s [tty_number [vnc args]]
\n
"
,
argv
[
0
]);
exit
(
1
);
exit
(
1
);
}
else
{
}
else
{
argv
++
;
argv
++
;
...
@@ -100,7 +100,7 @@ int main(int argc,char **argv)
...
@@ -100,7 +100,7 @@ int main(int argc,char **argv)
sprintf
(
tty_device
,
"/dev/tty%d"
,
tty
);
sprintf
(
tty_device
,
"/dev/tty%d"
,
tty
);
if
((
tty_inject_device
=
open
(
tty_device
,
O_WRONLY
))
<
0
)
{
if
((
tty_inject_device
=
open
(
tty_device
,
O_WRONLY
))
<
0
)
{
rfb
Log
(
"Couldn't open tty device %s!
\n
"
,
tty_device
);
rfb
Err
(
"Couldn't open tty device %s!
\n
"
,
tty_device
);
exit
(
1
);
exit
(
1
);
}
}
rfbLog
(
"Using device %s.
\n
"
,
tty_device
);
rfbLog
(
"Using device %s.
\n
"
,
tty_device
);
...
@@ -142,7 +142,7 @@ int main(int argc,char **argv)
...
@@ -142,7 +142,7 @@ int main(int argc,char **argv)
if
(
!
console
->
currentlyMarking
)
{
if
(
!
console
->
currentlyMarking
)
{
tty_file
=
fopen
(
tty_device
,
"rb"
);
tty_file
=
fopen
(
tty_device
,
"rb"
);
if
(
!
tty_file
)
{
if
(
!
tty_file
)
{
rfb
Log
(
"cannot open device
\"
%s
\"\n
"
,
rfb
Err
(
"cannot open device
\"
%s
\"\n
"
,
tty_device
);
tty_device
);
exit
(
1
);
exit
(
1
);
}
}
...
...
vncterm/VNCommand.c
View file @
4fcb6087
...
@@ -35,7 +35,7 @@ int main(int argc, char **argv)
...
@@ -35,7 +35,7 @@ int main(int argc, char **argv)
if
(
programArg0
<
argc
)
{
if
(
programArg0
<
argc
)
{
int
in
[
2
],
out
[
2
],
err
[
2
],
pid
;
int
in
[
2
],
out
[
2
],
err
[
2
],
pid
;
if
(
pipe
(
in
)
<
0
||
pipe
(
out
)
<
0
||
pipe
(
err
)
<
0
)
{
if
(
pipe
(
in
)
<
0
||
pipe
(
out
)
<
0
||
pipe
(
err
)
<
0
)
{
rfb
Log
(
"Couldn't make pipes!"
);
rfb
Err
(
"Couldn't make pipes!"
);
return
(
1
);
return
(
1
);
}
}
...
...
zlib.c
View file @
4fcb6087
...
@@ -164,7 +164,7 @@ rfbSendOneRectEncodingZlib(cl, x, y, w, h)
...
@@ -164,7 +164,7 @@ rfbSendOneRectEncodingZlib(cl, x, y, w, h)
zlibAfterBufLen
=
cl
->
compStream
.
total_out
-
previousOut
;
zlibAfterBufLen
=
cl
->
compStream
.
total_out
-
previousOut
;
if
(
deflateResult
!=
Z_OK
)
{
if
(
deflateResult
!=
Z_OK
)
{
rfb
Log
(
"zlib deflation error: %s
\n
"
,
cl
->
compStream
.
msg
);
rfb
Err
(
"zlib deflation error: %s
\n
"
,
cl
->
compStream
.
msg
);
return
FALSE
;
return
FALSE
;
}
}
...
...
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