summaryrefslogtreecommitdiffstats
path: root/libvncserver/websockets.c
Commit message (Collapse)AuthorAgeFilesLines
* `strings.h` and `resolv.h` are not available on MSVC, and some POSIX ↵Daniel Cohen Gindi2014-09-201-1/+4
| | | | | | 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.
* Set opcode correctly for binary frames.Joel Martin2013-02-271-0/+1
|
* Work around a gcc bug with anonymous structs and unions.Raphael Kubo da Costa2012-09-141-10/+15
| | | | | | | | | | GCC < 4.6 failed to parse the declaration of ws_header_t correctly because it did not accept anonymous structs and unions. [1] Work around the bug by adding names to the unions and structs. Ugly, but works. [1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4784
* Add the required headers for read(2)Raphael Kubo da Costa2012-09-141-0/+5
|
* Use htobeNN(3) to convert numbers in websocket.c.Raphael Kubo da Costa2012-09-141-14/+11
| | | | | | | | | byteswap.h exists only on glibc, so building libvncserver with websockets support was not possible in other systems. Replace the inclusion of byteswap.h and the WS_* definitions with calls to htobeNN, which should perform the same conversions, be more portable and avoid the need to check for the platform's endianness.
* Tune the definitions needed when building with -ansi.Raphael Kubo da Costa2012-09-141-1/+0
| | | | | | | | | | | | | 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.
* Add some missing feature macro definitions.Raphael Kubo da Costa2012-09-141-0/+5
| | | | | | | 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.
* Use C-style comments in rfbconfig.h.cmake and C source code.Raphael Kubo da Costa2012-09-141-1/+1
| | | | | Using C++-style comments when building the code with -ansi does not work, so be more conservative with the comment style.
* Correctly include rfbconfig.h.Raphael Kubo da Costa2012-09-141-1/+1
| | | | | build_dir/rfb is not passed as an include directory automatically to the compiler, so including that file fails.
* Fix some compiler warnings thrown with newer gcc.Christian Beier2012-04-251-2/+3
|
* websockets: removed debug messageGernot Tenchio2012-01-121-1/+1
|
* websockets: restore errno after logging an errorGernot Tenchio2012-01-121-6/+17
|
* Add support for different crypto implementationsGernot Tenchio2011-09-191-32/+19
|
* Update AUTHORS regarding the websocket guys.Christian Beier2011-09-191-0/+0
|
* websocket: Use a single buffer for both, encoding and decodingGernot Tenchio2011-09-081-16/+15
|
* Merge branch 'kanaka/websockets' into websocketsGernot Tenchio2011-08-301-197/+135
|\ | | | | | | | | Conflicts: libvncserver/websockets.c
| * websockets: fix webSocketCheckDisconnect()Gernot Tenchio2011-08-301-1/+1
| | | | | | | | Do not consume the peeked data if no close frame was detected.
| * websockets: use 32bit Xor in webSocketsDecodeHybi()Gernot Tenchio2011-08-291-5/+10
| |
| * Add sha1.*. Remove UTF-8 encode. Protocol handling.Joel Martin2011-08-251-175/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add common/sha1.h and common/sha1.c so that we have the SHA routines even if openssl is not available. From the IETF SHA RFC example code. Remove the UTF-8 encoding hack. This was really just an experiment. If the protocol passed in the handshake has "binary" then don't base64 encode for the HyBi protocol. This will allow noVNC to request the binary data be passed raw and not base64 encoded. Unfortunately, the client doesn't speak first in VNC protocol (bad original design). If it did then we could determine whether to base64 encode or not based on the first HyBi frame from the client and whether the binary bit is set or not. Oh well. Misc Cleanup: - Always free response and buf in handshake routine. - Remove some unused variables.
* | websockets: nothing to worry aboutGernot Tenchio2011-08-251-4/+5
| |
* | websockets: added gcrypt based sha1 digest funtionGernot Tenchio2011-08-251-0/+15
|/
* websockets: Removed debugging left overGernot Tenchio2011-08-251-1/+1
|
* websockets: Use callback functions for encode/decodeGernot Tenchio2011-08-251-17/+32
|
* websockets: Move Hixie disconnect hack to websockets.cGernot Tenchio2011-08-251-9/+75
| | | | | | 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.
* websockets: Initial HyBi supportGernot Tenchio2011-08-251-41/+389
|
* websockets: Add wspath member to rfbClientRecGernot Tenchio2011-08-171-0/+1
| | | | | | | Added wspath member to rfbClientRec which holds the path component of the initial websocket request. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
* websockets: Add encryption supportGernot Tenchio2011-08-171-12/+37
| | | | | | | [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>
* websockets: Properly parse Hixie-76 handshake.Joel Martin2011-08-171-21/+28
| | | | Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
* websockets: Add UTF-8 encoding support.Joel Martin2011-08-171-38/+68
| | | | | | | | | | | | | | | This is not completely standard UTF-8 encoding. Only code points 0-255 are encoded and never encoded to more than two octets. Since '\x00' is a WebSockets framing character, it's easier for all parties to encode zero as '\xc4\x80', i.e. 194+128, i.e. UTF-8 256. This means that a random stream will be slightly more than 50% larger using this encoding scheme. But it's easy CPU-wise for client and server to decode/encode. This is especially important for clients written in languages that have weak bitops, like Javascript (i.e. the noVNC client). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
* websockets: Initial WebSockets support.Joel Martin2011-08-171-0/+448
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>