Commit Graph

52 Commits (716bd27235fe6462271e799a758f2682fa4cb1de)

Author SHA1 Message Date
Tobias Junghans 09b2ed4381 Undef error codes before redefining them for WSA
Fixes compiler warnings about redefined macros from errno.h.
6 years ago
Christian Beier 01698f5c5b Merge pull request #128 from zmedico/autoprobe-selective
Support autoPort with ipv4 or ipv6 disabled
8 years ago
Kyle Russell 21fd4d27bb Support systemd socket activation 9 years ago
Zac Medico cdd81bd479 Support autoPort with ipv4 or ipv6 disabled
Make it possible to get autoPort behavior with either ipv4 or ipv6
disabled, by setting rfbScreen->ipv6port or rfbScreen->port to a
negative number. This will make it possible for x11vnc to enforce
its -noipv6 option, as discussed in the following bug report:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=672449
9 years ago
George Fleury 1417cb1c3f Avoid calling SSL_pending when connection is already closed
Avoid calling SSL_pending when connection is already closed, calling SSL_pending with connection already closed is crashing. 
To reproduce, open a secure websocket binay protocol connection with libvncserver compiled with OpenSSL, and when libvncserver is waiting for rfbProcessClientProtocolVersion send any invalid char, it will fail and call rfbCloseClient whith destroy all SSL context, calling SSL_pending after that will generate a invalid access.
9 years ago
Christian Beier 785f0fa2d1 Merge pull request #103 from rdieter/master
use namespaced vnc_max macro (issue #102)
9 years ago
Rex Dieter 53cc1fa18a use namespaced rfbMax macro (issue #102)
Not using generic 'max', avoids conflicts with stl_algobase.h
9 years ago
Wen Shuguang dfa5e27579 Enable AF_UNIX socket: ignore setsockopt TCP_NODELAY failure. 9 years ago
Stefan Weil 9c7efb7633 Fix some typos (found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
9 years ago
Floris Bos 6836ccb208 Fix handling of multiple VNC commands per websockets frame
- When processing input, check if there is any extra data
  pending in the internal websocket frame and SSL buffers.
- Prevents input events lagging behind because they get
  stuck in one of the buffers.
  Data pending in our own buffers cannot be detected with
  select() so was not processed until more input arrives
  from the network.
- Closes # 55

Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
10 years ago
Christian Beier 0aa204d818 Update comments regarding rfbClientConnectionGone(). 10 years ago
Daniel Cohen Gindi 901eba9f46 Generally adjusting headers for compiling on windows without the mixing of Winsock 1 and 2. 11 years ago
Daniel Cohen Gindi 026c48e7fc Fixed a violation of the C89 standard ("declarations must come before instructions") 11 years ago
Daniel Cohen Gindi fbf48c65f3 `strings.h` and `resolv.h` are not available on MSVC, and some POSIX functions are renamed or deprecated
For all of those missing/deprecated POSIX functions, we just add a macro mapping to the _underscored version of MSVC.
11 years ago
Amandeep Singh 012594b970 allow rfbInitSockets with non-ready states.
This allows for reinitializations of e. g. sockets in a SHUTDOWN state.
The only state that doesn't make sense to reinitialize are READY states.
11 years ago
Raphael Kubo da Costa 4c148e5f74 Tune the definitions needed when building with -ansi.
The current definitions were mostly useful to glibc and followed its
feature_test_macros(3) documentation.

However, this means other platforms still had problems when building with
strict compilation flags. _BSD_SOURCE, for example, is only recognized by
glibc, and other platforms sometimes need _XOPEN_SOURCE instead, or even the
removal of some definitions (such as the outdate _POSIX_SOURCE one).

_POSIX_SOURCE also had to be conditionally defined in some places, as what
it enables or disables during compilation varies across systems.
13 years ago
Raphael Kubo da Costa 8f1ef3d66c Add some missing feature macro definitions.
Building with -ansi failed due to some code (as well as system
headers) using non-C89 features. Fix that by adding the usual
_POSIX_SOURCE and _BSD_SOURCE definitions already present in some
other files.
13 years ago
Oliver Loch 584542ba97 Patched sockets.c to allow the use of IPv6 without IPv4.
As requested only those lines are indented that have been changed.
13 years ago
Kyle J. McKay 66282f5800 libvncserver/sockets.c: do not segfault when listenSock/listen6Sock == -1 13 years ago
Christian Beier 2d50fc84f7 IPv6 support for LibVNCServer, part four: add copyright notices to files with non-trivial changes. 13 years ago
Christian Beier 75bfb1f5d3 IPv6 support for LibVNCServer, part three: make reverse connections IPv6-capable.
Besided making libvncserver reverseVNC IPv6-aware, this introduces some changes
on the client side as well to make clients listen on IPv6 sockets, too. Like
the server side, this also uses a separate-socket approach.
13 years ago
Christian Beier edc75fa4f4 IPv6 support for LibVNCServer, part onepointseven: Plug a memleak.
We have to properly free the addrinfo struct when jumping out of the
function.
13 years ago
Christian Beier 23413bf120 IPv6 support for LibVNCServer, part onepointfive: Fix compilation with IPv6 missing.
There was an oversight that crept in...
13 years ago
Christian Beier 83a7c713a9 IPv6 support for LibVNCServer, part one: accept IPv4 and IPv6 connections.
This uses a separate-socket approach since there are systems that do not
support dual binding sockets under *any* circumstances, for instance
OpenBSD. Using separate sockets for IPv4 and IPv6 is thus more portable
than having a v6 socket handle v4 connections as well.

Signed-off-by: Christian Beier <dontmind@freeshell.org>
13 years ago
Gernot Tenchio 55234a37fd websockets: Move Hixie disconnect hack to websockets.c
Move the hixie disconnect hack to websockets.c. Removed
the remaining websockets vars from rfbClientPtr, so all
websockets stuff is hidden behind an opaque pointer.
14 years ago
Gernot Tenchio 1408866c86 websockets: Initial HyBi support 14 years ago
Gernot Tenchio 297072a691 websockets: Add wspath member to rfbClientRec
Added wspath member to rfbClientRec which holds the
path component of the initial websocket request.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
14 years ago
Gernot Tenchio 4aa3586367 websockets: Add encryption support
[jes: moved out GnuTLS and OpenSSL support, added a dummy support, to
separate changes better, and to keep things compiling]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
14 years ago
Joel Martin 6fac22a74b websockets: Initial WebSockets support.
Has a bug: WebSocket client disconnects are not detected.
rfbSendFramebufferUpdate is doing a MSG_PEEK recv to determine if
enough data is available which prevents a disconnect from being
detected.

Otherwise it's working pretty well.

[jes: moved added struct members to the end for binary compatibility with
previous LibVNCServer versions, removed an unused variable]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
14 years ago
Christian Beier 17ce0c5628 Remove some unused variables. 14 years ago
George Kiagiadakis ddd9b5ac7b Fix rfbProcessNewConnection to return some value instead of void.
BUG: 256891

Signed-off-by: Christian Beier <dontmind@freeshell.org>
14 years ago
George Kiagiadakis 9f8d8d4ef3 Split two event-loop related functions out of the rfbProcessEvents() mechanism.
This is required to be able to do proper event loop integration with Qt.
Idea was taken from vino's libvncserver fork.

Signed-off-by: Christian Beier <dontmind@freeshell.org>
14 years ago
Christian Beier e832999a58 Set proper file permissions for source files. 14 years ago
Christian Beier cf72a0f7c3 Call WSAGetLastError() everywhere errno is read after a Winsock call.
Winsock does NOT update errno for us, we have fetch the last error
manually using WSAGetLastError().
14 years ago
Tobias Doerffel d4fabc217e libvncserver sockets: check cl->screen before accessing it
In commit 079394ca5b new code with
insufficient checks was introduced causing a segfault when doing a
HTTP server connection. Such connections have no screen set in the
client data structure.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
14 years ago
Christian Beier 079394ca5b libvncserver sockets: favor per-screen maxclientwait over global one when set.
Signed-off-by: Christian Beier <dontmind@freeshell.org>
14 years ago
Christian Beier c0373e9cd4 Non-blocking sockets for Windows.
Expands the SetNonBlocking() function in libvncclient/sockets.c to also
work under Windows and also changes it to honour maybe already present
socket flags.

A similar function was introduced for libvncserver as well and
all the #ifdef'ed fnctl calls replaced with calls to that one.

Signed-off-by: Christian Beier <dontmind@freeshell.org>
15 years ago
runge f40b011182 Add locks of updateMutex in rfbRedrawAfterHideCursor() and
rfbSetClientColourMap().  Up listen limit from 5 to 32.
15 years ago
steven_carr ccdbe8f325 The great UltraVNC Compatibility Commit 19 years ago
dscho 0d40904d9f rfbCheckFds now returns the number of processed events 19 years ago
dscho f52cfa651b add handleEventsEagerly flag (Thanks, Donald) 19 years ago
dscho 1b81e342cb assorted fixes for MinGW32 19 years ago
dscho 3a8d4bdbe6 work around write() returning ENOENT on Solaris 2.7 19 years ago
dscho 0a909fde7a This monster commit contains support for TightVNC's file transfer protocol.
Thank you very much, Rohit!
20 years ago
dscho 93be927b1c Introduce generic protocol extension method. Deprecate
the processCustomClientMessage() method.
20 years ago
dscho 8bee4eb990 ANSIfy, fix some warnings from Linus' sparse 20 years ago
dscho 34f714bcdc socketInitDone -> socketState 20 years ago
runge b8b96689bf add '-listen ipaddr' option 20 years ago
dscho 658b65ad0c support MinGW32! 21 years ago
dscho 97299606da global structures/functions should have "rfb", "sra" or "zrle" as prefix,
while structure members should not
21 years ago