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
1b81e342
Commit
1b81e342
authored
Dec 19, 2005
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
assorted fixes for MinGW32
parent
3a8d4bdb
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
19 deletions
+24
-19
SDLvncviewer.c
client_examples/SDLvncviewer.c
+1
-0
sockets.c
libvncclient/sockets.c
+2
-3
vncviewer.c
libvncclient/vncviewer.c
+1
-1
main.c
libvncserver/main.c
+1
-1
rfbserver.c
libvncserver/rfbserver.c
+2
-0
sockets.c
libvncserver/sockets.c
+17
-14
No files found.
client_examples/SDLvncviewer.c
View file @
1b81e342
...
@@ -197,6 +197,7 @@ int main(int argc,char** argv) {
...
@@ -197,6 +197,7 @@ int main(int argc,char** argv) {
#endif
#endif
SDL_Init
(
SDL_INIT_VIDEO
|
SDL_INIT_NOPARACHUTE
);
SDL_Init
(
SDL_INIT_VIDEO
|
SDL_INIT_NOPARACHUTE
);
SDL_EnableUNICODE
(
1
);
/* 16-bit: cl=rfbGetClient(5,3,2); */
/* 16-bit: cl=rfbGetClient(5,3,2); */
cl
=
rfbGetClient
(
8
,
3
,
4
);
cl
=
rfbGetClient
(
8
,
3
,
4
);
...
...
libvncclient/sockets.c
View file @
1b81e342
...
@@ -91,12 +91,11 @@ ReadFromRFBServer(rfbClient* client, char *out, unsigned int n)
...
@@ -91,12 +91,11 @@ ReadFromRFBServer(rfbClient* client, char *out, unsigned int n)
diff
.
tv_sec
--
;
diff
.
tv_sec
--
;
diff
.
tv_usec
+=
1000000
;
diff
.
tv_usec
+=
1000000
;
}
}
sleep
(
diff
.
tv_sec
);
#ifndef __MINGW32__
#ifndef __MINGW32__
/* FIXME */
sleep
(
diff
.
tv_sec
);
usleep
(
diff
.
tv_usec
);
usleep
(
diff
.
tv_usec
);
#else
#else
rfbClientErr
(
"usleep on MinGW32 NOT IMPLEMENTED
\n
"
);
Sleep
(
diff
.
tv_sec
*
1000
+
diff
.
tv_usec
/
1000
);
#endif
#endif
}
}
...
...
libvncclient/vncviewer.c
View file @
1b81e342
...
@@ -252,6 +252,7 @@ rfbBool rfbInitClient(rfbClient* client,int* argc,char** argv) {
...
@@ -252,6 +252,7 @@ rfbBool rfbInitClient(rfbClient* client,int* argc,char** argv) {
}
}
void
rfbClientCleanup
(
rfbClient
*
client
)
{
void
rfbClientCleanup
(
rfbClient
*
client
)
{
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
int
i
;
int
i
;
for
(
i
=
0
;
i
<
4
;
i
++
)
{
for
(
i
=
0
;
i
<
4
;
i
++
)
{
...
@@ -268,7 +269,6 @@ void rfbClientCleanup(rfbClient* client) {
...
@@ -268,7 +269,6 @@ void rfbClientCleanup(rfbClient* client) {
rfbClientLog
(
"inflateEnd: %s
\n
"
,
client
->
decompStream
.
msg
);
rfbClientLog
(
"inflateEnd: %s
\n
"
,
client
->
decompStream
.
msg
);
}
}
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
if
(
client
->
jpegSrcManager
)
if
(
client
->
jpegSrcManager
)
free
(
client
->
jpegSrcManager
);
free
(
client
->
jpegSrcManager
);
#endif
#endif
...
...
libvncserver/main.c
View file @
1b81e342
...
@@ -852,7 +852,7 @@ void rfbInitServer(rfbScreenInfoPtr screen)
...
@@ -852,7 +852,7 @@ void rfbInitServer(rfbScreenInfoPtr screen)
{
{
#ifdef WIN32
#ifdef WIN32
WSADATA
trash
;
WSADATA
trash
;
int
i
=
WSAStartup
(
MAKEWORD
(
2
,
2
),
&
trash
);
WSAStartup
(
MAKEWORD
(
2
,
2
),
&
trash
);
#endif
#endif
rfbInitSockets
(
screen
);
rfbInitSockets
(
screen
);
rfbHttpInitSockets
(
screen
);
rfbHttpInitSockets
(
screen
);
...
...
libvncserver/rfbserver.c
View file @
1b81e342
...
@@ -412,7 +412,9 @@ rfbNewUDPClient(rfbScreenInfoPtr rfbScreen)
...
@@ -412,7 +412,9 @@ rfbNewUDPClient(rfbScreenInfoPtr rfbScreen)
void
void
rfbClientConnectionGone
(
rfbClientPtr
cl
)
rfbClientConnectionGone
(
rfbClientPtr
cl
)
{
{
#ifdef LIBVNCSERVER_HAVE_LIBJPEG
int
i
;
int
i
;
#endif
LOCK
(
rfbClientListMutex
);
LOCK
(
rfbClientListMutex
);
...
...
libvncserver/sockets.c
View file @
1b81e342
...
@@ -84,12 +84,15 @@ int deny_severity=LOG_WARNING;
...
@@ -84,12 +84,15 @@ int deny_severity=LOG_WARNING;
#endif
#endif
#if defined(WIN32)
#if defined(WIN32)
#ifndef __MINGW32__
#pragma warning (disable: 4018 4761)
#pragma warning (disable: 4018 4761)
#
define close closesocket
#
endif
#define read(sock,buf,len) recv(sock,buf,len,0)
#define read(sock,buf,len) recv(sock,buf,len,0)
#define EWOULDBLOCK WSAEWOULDBLOCK
#define EWOULDBLOCK WSAEWOULDBLOCK
#define ETIMEDOUT WSAETIMEDOUT
#define ETIMEDOUT WSAETIMEDOUT
#define write(sock,buf,len) send(sock,buf,len,0)
#define write(sock,buf,len) send(sock,buf,len,0)
#else
#define closesocket close
#endif
#endif
int
rfbMaxClientWait
=
20000
;
/* time (ms) after which we decide client has
int
rfbMaxClientWait
=
20000
;
/* time (ms) after which we decide client has
...
@@ -185,19 +188,19 @@ void rfbShutdownSockets(rfbScreenInfoPtr rfbScreen)
...
@@ -185,19 +188,19 @@ void rfbShutdownSockets(rfbScreenInfoPtr rfbScreen)
rfbScreen
->
socketState
=
RFB_SOCKET_SHUTDOWN
;
rfbScreen
->
socketState
=
RFB_SOCKET_SHUTDOWN
;
if
(
rfbScreen
->
inetdSock
>-
1
)
{
if
(
rfbScreen
->
inetdSock
>-
1
)
{
close
(
rfbScreen
->
inetdSock
);
close
socket
(
rfbScreen
->
inetdSock
);
FD_CLR
(
rfbScreen
->
inetdSock
,
&
rfbScreen
->
allFds
);
FD_CLR
(
rfbScreen
->
inetdSock
,
&
rfbScreen
->
allFds
);
rfbScreen
->
inetdSock
=-
1
;
rfbScreen
->
inetdSock
=-
1
;
}
}
if
(
rfbScreen
->
listenSock
>-
1
)
{
if
(
rfbScreen
->
listenSock
>-
1
)
{
close
(
rfbScreen
->
listenSock
);
close
socket
(
rfbScreen
->
listenSock
);
FD_CLR
(
rfbScreen
->
listenSock
,
&
rfbScreen
->
allFds
);
FD_CLR
(
rfbScreen
->
listenSock
,
&
rfbScreen
->
allFds
);
rfbScreen
->
listenSock
=-
1
;
rfbScreen
->
listenSock
=-
1
;
}
}
if
(
rfbScreen
->
udpSock
>-
1
)
{
if
(
rfbScreen
->
udpSock
>-
1
)
{
close
(
rfbScreen
->
udpSock
);
close
socket
(
rfbScreen
->
udpSock
);
FD_CLR
(
rfbScreen
->
udpSock
,
&
rfbScreen
->
allFds
);
FD_CLR
(
rfbScreen
->
udpSock
,
&
rfbScreen
->
allFds
);
rfbScreen
->
udpSock
=-
1
;
rfbScreen
->
udpSock
=-
1
;
}
}
...
@@ -256,7 +259,7 @@ rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
...
@@ -256,7 +259,7 @@ rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
#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"
);
close
(
sock
);
close
socket
(
sock
);
return
;
return
;
}
}
#endif
#endif
...
@@ -264,7 +267,7 @@ rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
...
@@ -264,7 +267,7 @@ rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
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"
);
close
(
sock
);
close
socket
(
sock
);
return
;
return
;
}
}
...
@@ -273,7 +276,7 @@ rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
...
@@ -273,7 +276,7 @@ rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
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
));
close
(
sock
);
close
socket
(
sock
);
return
;
return
;
}
}
#endif
#endif
...
@@ -364,7 +367,7 @@ rfbCloseClient(rfbClientPtr cl)
...
@@ -364,7 +367,7 @@ rfbCloseClient(rfbClientPtr cl)
#ifndef __MINGW32__
#ifndef __MINGW32__
shutdown
(
cl
->
sock
,
SHUT_RDWR
);
shutdown
(
cl
->
sock
,
SHUT_RDWR
);
#endif
#endif
close
(
cl
->
sock
);
close
socket
(
cl
->
sock
);
cl
->
sock
=
-
1
;
cl
->
sock
=
-
1
;
}
}
TSIGNAL
(
cl
->
updateCond
);
TSIGNAL
(
cl
->
updateCond
);
...
@@ -395,7 +398,7 @@ rfbConnect(rfbScreenInfoPtr rfbScreen,
...
@@ -395,7 +398,7 @@ rfbConnect(rfbScreenInfoPtr rfbScreen,
#ifndef WIN32
#ifndef WIN32
if
(
fcntl
(
sock
,
F_SETFL
,
O_NONBLOCK
)
<
0
)
{
if
(
fcntl
(
sock
,
F_SETFL
,
O_NONBLOCK
)
<
0
)
{
rfbLogPerror
(
"fcntl failed"
);
rfbLogPerror
(
"fcntl failed"
);
close
(
sock
);
close
socket
(
sock
);
return
-
1
;
return
-
1
;
}
}
#endif
#endif
...
@@ -403,7 +406,7 @@ rfbConnect(rfbScreenInfoPtr rfbScreen,
...
@@ -403,7 +406,7 @@ rfbConnect(rfbScreenInfoPtr rfbScreen,
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
(
"setsockopt failed"
);
rfbLogPerror
(
"setsockopt failed"
);
close
(
sock
);
close
socket
(
sock
);
return
-
1
;
return
-
1
;
}
}
...
@@ -605,15 +608,15 @@ rfbListenOnTCPPort(int port,
...
@@ -605,15 +608,15 @@ rfbListenOnTCPPort(int port,
}
}
if
(
setsockopt
(
sock
,
SOL_SOCKET
,
SO_REUSEADDR
,
if
(
setsockopt
(
sock
,
SOL_SOCKET
,
SO_REUSEADDR
,
(
char
*
)
&
one
,
sizeof
(
one
))
<
0
)
{
(
char
*
)
&
one
,
sizeof
(
one
))
<
0
)
{
close
(
sock
);
close
socket
(
sock
);
return
-
1
;
return
-
1
;
}
}
if
(
bind
(
sock
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
addr
))
<
0
)
{
if
(
bind
(
sock
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
addr
))
<
0
)
{
close
(
sock
);
close
socket
(
sock
);
return
-
1
;
return
-
1
;
}
}
if
(
listen
(
sock
,
5
)
<
0
)
{
if
(
listen
(
sock
,
5
)
<
0
)
{
close
(
sock
);
close
socket
(
sock
);
return
-
1
;
return
-
1
;
}
}
...
@@ -646,7 +649,7 @@ rfbConnectToTcpAddr(char *host,
...
@@ -646,7 +649,7 @@ rfbConnectToTcpAddr(char *host,
}
}
if
(
connect
(
sock
,
(
struct
sockaddr
*
)
&
addr
,
(
sizeof
(
addr
)))
<
0
)
{
if
(
connect
(
sock
,
(
struct
sockaddr
*
)
&
addr
,
(
sizeof
(
addr
)))
<
0
)
{
close
(
sock
);
close
socket
(
sock
);
return
-
1
;
return
-
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