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
7d3b1c97
Commit
7d3b1c97
authored
Dec 01, 2004
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use rfbClientErr to log errors, check if calloc succeded (both hinted by Andre Leiradella)
parent
c641923d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
17 deletions
+21
-17
AUTHORS
AUTHORS
+1
-1
listen.c
libvncclient/listen.c
+1
-1
sockets.c
libvncclient/sockets.c
+15
-15
vncviewer.c
libvncclient/vncviewer.c
+4
-0
No files found.
AUTHORS
View file @
7d3b1c97
...
...
@@ -24,7 +24,7 @@ archives and please don't beat me, if I forgot you, but just send me an
email!): Akira Hatakeyama, Karl J. Runge, Justin "Zippy" Dearing,
Oliver Mihatsch, Greg Sternberg, Werner Hofer, Giampiero Giancipoli,
Glenn Mabutt, Paul Kreiner, Erik Kunze, Mike Frysinger, Martin Waitz,
Mark McLoughlin, Paul Fox, Juan Jose Costello.
Mark McLoughlin, Paul Fox, Juan Jose Costello
, Andre Leiadella
.
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
...
...
libvncclient/listen.c
View file @
7d3b1c97
...
...
@@ -77,7 +77,7 @@ listenForIncomingConnections(rfbClient* client)
switch
(
fork
())
{
case
-
1
:
perro
r
(
"fork"
);
rfbClientEr
r
(
"fork"
);
return
;
case
0
:
...
...
libvncclient/sockets.c
View file @
7d3b1c97
...
...
@@ -120,7 +120,7 @@ ReadFromRFBServer(rfbClient* client, char *out, unsigned int n)
*/
i
=
0
;
}
else
{
perro
r
(
"read"
);
rfbClientEr
r
(
"read"
);
return
FALSE
;
}
}
else
{
...
...
@@ -149,7 +149,7 @@ ReadFromRFBServer(rfbClient* client, char *out, unsigned int n)
*/
i
=
0
;
}
else
{
perro
r
(
"read"
);
rfbClientEr
r
(
"read"
);
return
FALSE
;
}
}
else
{
...
...
@@ -200,12 +200,12 @@ WriteToRFBServer(rfbClient* client, char *buf, int n)
FD_SET
(
client
->
sock
,
&
fds
);
if
(
select
(
client
->
sock
+
1
,
NULL
,
&
fds
,
NULL
,
NULL
)
<=
0
)
{
perro
r
(
"select"
);
rfbClientEr
r
(
"select"
);
return
FALSE
;
}
j
=
0
;
}
else
{
perro
r
(
"write"
);
rfbClientEr
r
(
"write"
);
return
FALSE
;
}
}
else
{
...
...
@@ -236,19 +236,19 @@ ConnectClientToTcpAddr(unsigned int host, int port)
sock
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
if
(
sock
<
0
)
{
perro
r
(
"ConnectToTcpAddr: socket"
);
rfbClientEr
r
(
"ConnectToTcpAddr: socket"
);
return
-
1
;
}
if
(
connect
(
sock
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
addr
))
<
0
)
{
perro
r
(
"ConnectToTcpAddr: connect"
);
rfbClientEr
r
(
"ConnectToTcpAddr: connect"
);
close
(
sock
);
return
-
1
;
}
if
(
setsockopt
(
sock
,
IPPROTO_TCP
,
TCP_NODELAY
,
(
char
*
)
&
one
,
sizeof
(
one
))
<
0
)
{
perro
r
(
"ConnectToTcpAddr: setsockopt"
);
rfbClientEr
r
(
"ConnectToTcpAddr: setsockopt"
);
close
(
sock
);
return
-
1
;
}
...
...
@@ -274,7 +274,7 @@ FindFreeTcpPort(void)
sock
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
if
(
sock
<
0
)
{
perro
r
(
": FindFreeTcpPort: socket"
);
rfbClientEr
r
(
": FindFreeTcpPort: socket"
);
return
0
;
}
...
...
@@ -308,25 +308,25 @@ ListenAtTcpPort(int port)
sock
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
if
(
sock
<
0
)
{
perro
r
(
"ListenAtTcpPort: socket"
);
rfbClientEr
r
(
"ListenAtTcpPort: socket"
);
return
-
1
;
}
if
(
setsockopt
(
sock
,
SOL_SOCKET
,
SO_REUSEADDR
,
(
const
char
*
)
&
one
,
sizeof
(
one
))
<
0
)
{
perro
r
(
"ListenAtTcpPort: setsockopt"
);
rfbClientEr
r
(
"ListenAtTcpPort: setsockopt"
);
close
(
sock
);
return
-
1
;
}
if
(
bind
(
sock
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
addr
))
<
0
)
{
perro
r
(
"ListenAtTcpPort: bind"
);
rfbClientEr
r
(
"ListenAtTcpPort: bind"
);
close
(
sock
);
return
-
1
;
}
if
(
listen
(
sock
,
5
)
<
0
)
{
perro
r
(
"ListenAtTcpPort: listen"
);
rfbClientEr
r
(
"ListenAtTcpPort: listen"
);
close
(
sock
);
return
-
1
;
}
...
...
@@ -349,13 +349,13 @@ AcceptTcpConnection(int listenSock)
sock
=
accept
(
listenSock
,
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
);
if
(
sock
<
0
)
{
perro
r
(
"AcceptTcpConnection: accept"
);
rfbClientEr
r
(
"AcceptTcpConnection: accept"
);
return
-
1
;
}
if
(
setsockopt
(
sock
,
IPPROTO_TCP
,
TCP_NODELAY
,
(
char
*
)
&
one
,
sizeof
(
one
))
<
0
)
{
perro
r
(
"AcceptTcpConnection: setsockopt"
);
rfbClientEr
r
(
"AcceptTcpConnection: setsockopt"
);
close
(
sock
);
return
-
1
;
}
...
...
@@ -372,7 +372,7 @@ rfbBool
SetNonBlocking
(
int
sock
)
{
if
(
fcntl
(
sock
,
F_SETFL
,
O_NONBLOCK
)
<
0
)
{
perro
r
(
"AcceptTcpConnection: fcntl"
);
rfbClientEr
r
(
"AcceptTcpConnection: fcntl"
);
return
FALSE
;
}
return
TRUE
;
...
...
libvncclient/vncviewer.c
View file @
7d3b1c97
...
...
@@ -91,6 +91,10 @@ static void initAppData(AppData* data) {
rfbClient
*
rfbGetClient
(
int
bitsPerSample
,
int
samplesPerPixel
,
int
bytesPerPixel
)
{
rfbClient
*
client
=
(
rfbClient
*
)
calloc
(
sizeof
(
rfbClient
),
1
);
if
(
!
client
)
{
rfbClientErr
(
"Couldn't allocate client structure!
\n
"
);
return
0
;
}
initAppData
(
&
client
->
appData
);
client
->
programName
=
0
;
client
->
endianTest
=
1
;
...
...
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