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
9fb7fef3
Commit
9fb7fef3
authored
Jan 16, 2002
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean ups and encoding "backchannel"
parent
94570b01
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
69 additions
and
8 deletions
+69
-8
1instance.c
1instance.c
+2
-0
Makefile
Makefile
+1
-1
cargs.c
cargs.c
+1
-1
mac.c
mac.c
+11
-0
rfb.h
rfb.h
+5
-2
rfbproto.h
rfbproto.h
+10
-2
rfbserver.c
rfbserver.c
+26
-0
x11vnc.c
x11vnc.c
+13
-2
No files found.
1instance.c
View file @
9fb7fef3
...
...
@@ -98,7 +98,9 @@ int loop_if_server(single_instance_struct* str,event_dispatcher dispatcher)
void
send_message
(
single_instance_struct
*
str
,
char
*
message
)
{
#ifdef DEBUG_1INSTANCE
int
i
=
#endif
write
(
str
->
fd
,
message
,
strlen
(
message
));
#ifdef DEBUG_1INSTANCE
fprintf
(
stderr
,
"send: %s => %d(%d)
\n
"
,
message
,
i
,
strlen
(
message
));
...
...
Makefile
View file @
9fb7fef3
...
...
@@ -11,7 +11,7 @@ FLAG24 = -DALLOW24BPP
#OPTFLAGS=-g # -Wall
OPTFLAGS
=
-O2
-Wall
CFLAGS
=
$(OPTFLAGS)
$(PTHREADDEF)
$(FLAG24)
$(INCLUDES)
CFLAGS
=
$(OPTFLAGS)
$(PTHREADDEF)
$(FLAG24)
$(INCLUDES)
-DBACKCHANNEL
RANLIB
=
ranlib
LIBS
=
$(LDFLAGS)
$(VNCSERVERLIB)
$(PTHREADLIB)
...
...
cargs.c
View file @
9fb7fef3
...
...
@@ -60,7 +60,7 @@ rfbProcessArguments(rfbScreenInfoPtr rfbScreen,int* argc, char *argv[])
if
(
i
+
1
>=
*
argc
)
rfbUsage
();
passwds
[
0
]
=
argv
[
++
i
];
passwds
[
1
]
=
0
;
rfbScreen
->
rfbAuthPasswdData
=
passwds
;
rfbScreen
->
rfbAuthPasswdData
=
(
void
*
)
passwds
;
rfbScreen
->
passwordCheck
=
rfbCheckPasswordByList
;
}
else
if
(
strcmp
(
argv
[
i
],
"-deferupdate"
)
==
0
)
{
/* -desktop desktop-name */
if
(
i
+
1
>=
*
argc
)
rfbUsage
();
...
...
mac.c
View file @
9fb7fef3
...
...
@@ -327,6 +327,10 @@ refreshCallback(CGRectCount count, const CGRect *rectArray, void *ignore)
break
;
}
}
#ifdef BACKCHANNEL
else
if
(
message
[
0
]
==
'b'
)
rfbSendBackChannel
(
screen
,
message
+
1
,
strlen
(
message
+
1
));
#endif
}
#endif
...
...
@@ -377,6 +381,13 @@ int main(int argc,char *argv[])
send_message
(
&
single_instance
,
"l"
);
exit
(
0
);
}
else
#ifdef BACKCHANNEL
if
(
i
<
argc
-
1
&&
!
strcmp
(
argv
[
i
],
"-backchannel"
))
{
sprintf
(
message
,
"b%s"
,
argv
[
i
+
1
]);
send_message
(
&
single_instance
,
message
);
exit
(
0
);
}
else
#endif
#endif
if
(
i
<
argc
-
1
&&
strcmp
(
argv
[
i
],
"-wait4client"
)
==
0
)
{
maxSecsToConnect
=
atoi
(
argv
[
i
+
1
])
/
1000
;
...
...
rfb.h
View file @
9fb7fef3
...
...
@@ -273,7 +273,7 @@ typedef struct
FILE
*
httpFP
;
PasswordCheckProcPtr
passwordCheck
;
char
*
rfbAuthPasswdData
;
void
*
rfbAuthPasswdData
;
/* this is the amount of milliseconds to wait at least before sending
* an update. */
...
...
@@ -574,6 +574,10 @@ extern void rfbSendBell(rfbScreenInfoPtr rfbScreen);
void
rfbGotXCutText
(
rfbScreenInfoPtr
rfbScreen
,
char
*
str
,
int
len
);
#ifdef BACKCHANNEL
extern
void
rfbSendBackChannel
(
rfbScreenInfoPtr
s
,
char
*
message
,
int
len
);
#endif
/* translate.c */
extern
Bool
rfbEconomicTranslate
;
...
...
@@ -599,7 +603,6 @@ extern void httpCheckFds();
/* auth.c */
extern
char
*
rfbAuthPasswdFile
;
extern
void
rfbAuthNewClient
(
rfbClientPtr
cl
);
extern
void
rfbAuthProcessClientMessage
(
rfbClientPtr
cl
);
...
...
rfbproto.h
View file @
9fb7fef3
...
...
@@ -268,7 +268,9 @@ typedef struct {
#define rfbSetColourMapEntries 1
#define rfbBell 2
#define rfbServerCutText 3
#ifdef BACKCHANNEL
#define rfbBackChannel 15
#endif
/* client -> server */
...
...
@@ -297,6 +299,9 @@ typedef struct {
#define rfbEncodingZlib 6
#define rfbEncodingTight 7
#define rfbEncodingZlibHex 8
#ifdef BACKCHANNEL
#define rfbEncodingBackChannel 15
#endif
/*
* Special encoding numbers:
...
...
@@ -508,7 +513,6 @@ typedef struct {
#define rfbTightFilterPalette 0x01
#define rfbTightFilterGradient 0x02
/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* XCursor encoding. This is a special encoding used to transmit X-style
* cursor shapes from server to clients. Note that for this encoding,
...
...
@@ -604,6 +608,10 @@ typedef struct {
#define sz_rfbServerCutTextMsg 8
#ifdef BACKCHANNEL
typedef
rfbServerCutTextMsg
rfbBackChannelMsg
;
#endif
/*-----------------------------------------------------------------------------
* Union of all server->client messages.
...
...
rfbserver.c
View file @
9fb7fef3
...
...
@@ -1460,3 +1460,29 @@ rfbProcessUDPInput(rfbScreenInfoPtr rfbScreen)
rfbDisconnectUDPSock
(
rfbScreen
);
}
}
#ifdef BACKCHANNEL
void
rfbSendBackChannel
(
rfbScreenInfoPtr
rfbScreen
,
char
*
str
,
int
len
)
{
rfbClientPtr
cl
;
rfbBackChannelMsg
sct
;
rfbClientIteratorPtr
iterator
;
iterator
=
rfbGetClientIterator
(
rfbScreen
);
while
((
cl
=
rfbClientIteratorNext
(
iterator
))
!=
NULL
)
{
sct
.
type
=
rfbBackChannel
;
sct
.
length
=
Swap32IfLE
(
len
);
if
(
WriteExact
(
cl
,
(
char
*
)
&
sct
,
sz_rfbServerCutTextMsg
)
<
0
)
{
rfbLogPerror
(
"rfbSendServerCutText: write"
);
rfbCloseClient
(
cl
);
continue
;
}
if
(
WriteExact
(
cl
,
str
,
len
)
<
0
)
{
rfbLogPerror
(
"rfbSendServerCutText: write"
);
rfbCloseClient
(
cl
);
}
}
rfbReleaseClientIterator
(
iterator
);
}
#endif
x11vnc.c
View file @
9fb7fef3
...
...
@@ -232,8 +232,8 @@ int probeX=0,probeY=0;
void
probeScreen
(
rfbScreenInfoPtr
s
,
int
xscreen
)
{
int
i
,
j
,
pixel
,
i1
,
j1
,
bpp
=
s
->
rfbServerFormat
.
bitsPerPixel
/
8
,
mask
=
(
1
<<
bpp
)
-
1
,
int
i
,
j
,
/*pixel,i1,*/
j1
,
bpp
=
s
->
rfbServerFormat
.
bitsPerPixel
/
8
,
/*mask=(1<<bpp)-1,*/
rstride
=
s
->
paddedWidthInBytes
;
XImage
*
im
;
//fprintf(stderr,"/%d,%d",probeX,probeY);
...
...
@@ -316,6 +316,13 @@ int main(int argc,char** argv)
send_message
(
&
single_instance
,
"l"
);
exit
(
0
);
}
else
#ifdef BACKCHANNEL
if
(
i
<
argc
-
1
&&
!
strcmp
(
argv
[
i
],
"-backchannel"
))
{
sprintf
(
message
,
"b%s"
,
argv
[
i
+
1
]);
send_message
(
&
single_instance
,
message
);
exit
(
0
);
}
else
#endif
#endif
if
(
i
<
argc
-
1
&&
strcmp
(
argv
[
i
],
"-display"
)
==
0
)
{
fprintf
(
stderr
,
"Using display %s
\n
"
,
argv
[
i
+
1
]);
...
...
@@ -459,6 +466,10 @@ int main(int argc,char** argv)
break
;
}
}
#ifdef BACKCHANNEL
else
if
(
message
[
0
]
==
'b'
)
rfbSendBackChannel
(
screen
,
message
+
1
,
strlen
(
message
+
1
));
#endif
}
#endif
...
...
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