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
e66eeecd
Commit
e66eeecd
authored
Apr 23, 2002
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync with TightVNC 1.2.3
parent
fd2931c0
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
99 additions
and
51 deletions
+99
-51
CHANGES
CHANGES
+1
-0
VncViewer.jar
classes/VncViewer.jar
+0
-0
index.vnc
classes/index.vnc
+2
-1
vncviewer.jar
classes/vncviewer.jar
+0
-0
httpd.c
httpd.c
+77
-49
rfbserver.c
rfbserver.c
+2
-1
sockets.c
sockets.c
+17
-0
No files found.
CHANGES
View file @
e66eeecd
synced with TightVNC 1.2.3
solaris compile cleanups
solaris compile cleanups
many x11vnc improvements
many x11vnc improvements
added backchannel, an encoding which needs special clients to pass
added backchannel, an encoding which needs special clients to pass
...
...
classes/VncViewer.jar
0 → 100644
View file @
e66eeecd
File added
classes/index.vnc
View file @
e66eeecd
...
@@ -8,9 +8,10 @@
...
@@ -8,9 +8,10 @@
<TITLE>
<TITLE>
$USER's $DESKTOP desktop ($DISPLAY)
$USER's $DESKTOP desktop ($DISPLAY)
</TITLE>
</TITLE>
<APPLET CODE=vncviewer.class ARCHIVE=
vncv
iewer.jar
<APPLET CODE=vncviewer.class ARCHIVE=
VncV
iewer.jar
WIDTH=$APPLETWIDTH HEIGHT=$APPLETHEIGHT>
WIDTH=$APPLETWIDTH HEIGHT=$APPLETHEIGHT>
<param name=PORT value=$PORT>
<param name=PORT value=$PORT>
</APPLET>
</APPLET>
<BR>
<A href="http://www.tightvnc.com/">www.TightVNC.com</A>
<A href="http://www.tightvnc.com/">www.TightVNC.com</A>
</HTML>
</HTML>
classes/vncviewer.jar
deleted
100644 → 0
View file @
fd2931c0
File deleted
httpd.c
View file @
e66eeecd
...
@@ -39,6 +39,10 @@
...
@@ -39,6 +39,10 @@
#include <fcntl.h>
#include <fcntl.h>
#include <errno.h>
#include <errno.h>
#ifdef USE_LIBWRAP
#include <tcpd.h>
#endif
#include "rfb.h"
#include "rfb.h"
#define NOT_FOUND_STR "HTTP/1.0 404 Not found\n\n" \
#define NOT_FOUND_STR "HTTP/1.0 404 Not found\n\n" \
...
@@ -62,6 +66,7 @@ FILE* httpFP = NULL;
...
@@ -62,6 +66,7 @@ FILE* httpFP = NULL;
#define BUF_SIZE 32768
#define BUF_SIZE 32768
static
char
buf
[
BUF_SIZE
];
static
char
buf
[
BUF_SIZE
];
static
size_t
buf_filled
=
0
;
/*
/*
...
@@ -137,6 +142,7 @@ httpCheckFds(rfbScreenInfoPtr rfbScreen)
...
@@ -137,6 +142,7 @@ httpCheckFds(rfbScreenInfoPtr rfbScreen)
}
}
if
(
FD_ISSET
(
rfbScreen
->
httpListenSock
,
&
fds
))
{
if
(
FD_ISSET
(
rfbScreen
->
httpListenSock
,
&
fds
))
{
int
flags
;
if
(
rfbScreen
->
httpSock
>=
0
)
close
(
rfbScreen
->
httpSock
);
if
(
rfbScreen
->
httpSock
>=
0
)
close
(
rfbScreen
->
httpSock
);
if
((
rfbScreen
->
httpSock
=
accept
(
rfbScreen
->
httpListenSock
,
if
((
rfbScreen
->
httpSock
=
accept
(
rfbScreen
->
httpListenSock
,
...
@@ -144,12 +150,27 @@ httpCheckFds(rfbScreenInfoPtr rfbScreen)
...
@@ -144,12 +150,27 @@ httpCheckFds(rfbScreenInfoPtr rfbScreen)
rfbLogPerror
(
"httpCheckFds: accept"
);
rfbLogPerror
(
"httpCheckFds: accept"
);
return
;
return
;
}
}
#ifdef USE_LIBWRAP
if
(
!
hosts_ctl
(
"vnc"
,
STRING_UNKNOWN
,
inet_ntoa
(
addr
.
sin_addr
),
STRING_UNKNOWN
))
{
rfbLog
(
"Rejected connection from client %s
\n
"
,
inet_ntoa
(
addr
.
sin_addr
));
#else
if
((
rfbScreen
->
httpFP
=
fdopen
(
rfbScreen
->
httpSock
,
"r+"
))
==
NULL
)
{
if
((
rfbScreen
->
httpFP
=
fdopen
(
rfbScreen
->
httpSock
,
"r+"
))
==
NULL
)
{
rfbLogPerror
(
"httpCheckFds: fdopen"
);
rfbLogPerror
(
"httpCheckFds: fdopen"
);
#endif
close
(
rfbScreen
->
httpSock
);
close
(
rfbScreen
->
httpSock
);
rfbScreen
->
httpSock
=
-
1
;
rfbScreen
->
httpSock
=
-
1
;
return
;
return
;
}
}
flags
=
fcntl
(
rfbScreen
->
httpSock
,
F_GETFL
);
if
(
flags
==-
1
||
fcntl
(
rfbScreen
->
httpSock
,
F_SETFL
,
flags
|
O_NONBLOCK
)
==-
1
)
{
rfbLogPerror
(
"httpCheckFds: fcntl"
);
close
(
rfbScreen
->
httpSock
);
rfbScreen
->
httpSock
=-
1
;
return
;
}
/*AddEnabledDevice(httpSock);*/
/*AddEnabledDevice(httpSock);*/
}
}
...
@@ -180,11 +201,10 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
...
@@ -180,11 +201,10 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
char
*
fname
;
char
*
fname
;
unsigned
int
maxFnameLen
;
unsigned
int
maxFnameLen
;
FILE
*
fd
;
FILE
*
fd
;
Bool
gotGet
=
FALSE
;
Bool
performSubstitutions
=
FALSE
;
Bool
performSubstitutions
=
FALSE
;
char
str
[
256
];
char
str
[
256
];
#ifndef WIN32
#ifndef WIN32
struct
passwd
*
user
=
getpwuid
(
getuid
());
;
struct
passwd
*
user
=
getpwuid
(
getuid
());
#endif
#endif
cl
.
sock
=
rfbScreen
->
httpSock
;
cl
.
sock
=
rfbScreen
->
httpSock
;
...
@@ -198,26 +218,43 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
...
@@ -198,26 +218,43 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
fname
=
&
fullFname
[
strlen
(
fullFname
)];
fname
=
&
fullFname
[
strlen
(
fullFname
)];
maxFnameLen
=
255
-
strlen
(
fullFname
);
maxFnameLen
=
255
-
strlen
(
fullFname
);
buf
[
0
]
=
'\0'
;
/* Read data from the HTTP client until we get a complete request. */
while
(
1
)
{
while
(
1
)
{
ssize_t
got
=
read
(
rfbScreen
->
httpSock
,
buf
+
buf_filled
,
sizeof
(
buf
)
-
buf_filled
-
1
);
/* Read lines from the HTTP client until a blank line. The only
if
(
got
<=
0
)
{
line we need to parse is the line "GET <filename> ..." */
if
(
got
==
0
)
{
rfbLog
(
"httpd: premature connection close
\n
"
);
if
(
!
fgets
(
buf
,
BUF_SIZE
,
rfbScreen
->
httpFP
))
{
}
else
{
rfbLogPerror
(
"httpProcessInput: fgets"
);
if
(
errno
==
EAGAIN
)
{
return
;
}
rfbLogPerror
(
"httpProcessInput: read"
);
}
httpCloseSock
(
rfbScreen
);
httpCloseSock
(
rfbScreen
);
return
;
return
;
}
}
if
((
strcmp
(
buf
,
"
\n
"
)
==
0
)
||
(
strcmp
(
buf
,
"
\r\n
"
)
==
0
)
buf_filled
+=
got
;
||
(
strcmp
(
buf
,
"
\r
"
)
==
0
)
||
(
strcmp
(
buf
,
"
\n\r
"
)
==
0
))
buf
[
buf_filled
]
=
'\0'
;
/* end of client request */
/* Is it complete yet (is there a blank line)? */
if
(
strstr
(
buf
,
"
\r\r
"
)
||
strstr
(
buf
,
"
\n\n
"
)
||
strstr
(
buf
,
"
\r\n\r\n
"
)
||
strstr
(
buf
,
"
\n\r\n\r
"
))
break
;
break
;
}
if
(
strncmp
(
buf
,
"GET "
,
4
)
==
0
)
{
gotGet
=
TRUE
;
/* Process the request. */
if
(
strncmp
(
buf
,
"GET "
,
4
))
{
rfbLog
(
"no GET line
\n
"
);
httpCloseSock
(
rfbScreen
);
return
;
}
else
{
/* Only use the first line. */
buf
[
strcspn
(
buf
,
"
\n\r
"
)]
=
'\0'
;
}
if
(
strlen
(
buf
)
>
maxFnameLen
)
{
if
(
strlen
(
buf
)
>
maxFnameLen
)
{
rfbLog
(
"GET line too long
\n
"
);
rfbLog
(
"GET line too long
\n
"
);
...
@@ -248,15 +285,6 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
...
@@ -248,15 +285,6 @@ httpProcessInput(rfbScreenInfoPtr rfbScreen)
getpeername
(
rfbScreen
->
httpSock
,
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
);
getpeername
(
rfbScreen
->
httpSock
,
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
);
rfbLog
(
"httpd: get '%s' for %s
\n
"
,
fname
+
1
,
rfbLog
(
"httpd: get '%s' for %s
\n
"
,
fname
+
1
,
inet_ntoa
(
addr
.
sin_addr
));
inet_ntoa
(
addr
.
sin_addr
));
continue
;
}
}
if
(
!
gotGet
)
{
rfbLog
(
"no GET line
\n
"
);
httpCloseSock
(
rfbScreen
);
return
;
}
/* If we were asked for '/', actually read the file index.vnc */
/* If we were asked for '/', actually read the file index.vnc */
...
...
rfbserver.c
View file @
e66eeecd
...
@@ -1208,7 +1208,8 @@ rfbSendRectEncodingRaw(cl, x, y, w, h)
...
@@ -1208,7 +1208,8 @@ rfbSendRectEncodingRaw(cl, x, y, w, h)
char
*
fbptr
=
(
cl
->
screen
->
frameBuffer
+
(
cl
->
screen
->
paddedWidthInBytes
*
y
)
char
*
fbptr
=
(
cl
->
screen
->
frameBuffer
+
(
cl
->
screen
->
paddedWidthInBytes
*
y
)
+
(
x
*
(
cl
->
screen
->
bitsPerPixel
/
8
)));
+
(
x
*
(
cl
->
screen
->
bitsPerPixel
/
8
)));
if
(
cl
->
ublen
+
sz_rfbFramebufferUpdateRectHeader
>
UPDATE_BUF_SIZE
)
{
/* Flush the buffer to guarantee correct alignment for translateFn(). */
if
(
cl
->
ublen
>
0
)
{
if
(
!
rfbSendUpdateBuf
(
cl
))
if
(
!
rfbSendUpdateBuf
(
cl
))
return
FALSE
;
return
FALSE
;
}
}
...
...
sockets.c
View file @
e66eeecd
...
@@ -67,6 +67,13 @@ struct timeval
...
@@ -67,6 +67,13 @@ struct timeval
#include <fcntl.h>
#include <fcntl.h>
#include <errno.h>
#include <errno.h>
#ifdef USE_LIBWRAP
#include <syslog.h>
#include <tcpd.h>
int
allow_severity
=
LOG_INFO
;
int
deny_severity
=
LOG_WARNING
;
#endif
#include "rfb.h"
#include "rfb.h"
/*#ifndef WIN32
/*#ifndef WIN32
...
@@ -223,6 +230,16 @@ rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
...
@@ -223,6 +230,16 @@ rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
return
;
return
;
}
}
#ifdef USE_LIBWRAP
if
(
!
hosts_ctl
(
"vnc"
,
STRING_UNKNOWN
,
inet_ntoa
(
addr
.
sin_addr
),
STRING_UNKNOWN
))
{
rfbLog
(
"Rejected connection from client %s
\n
"
,
inet_ntoa
(
addr
.
sin_addr
));
close
(
sock
);
return
;
}
#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
);
...
...
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