aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb
Commit message (Collapse)AuthorAgeFilesLines
* Capitalize first letter in log, exception & errorMadeleine Nilsson2024-11-218-29/+29
| | | | The reason for this is to keep a consistency through out the project.
* Standardize log message prefix formatMadeleine Nilsson2024-11-111-2/+2
| | | | The reason for this is to keep a consistency through out the project.
* Standardize on sentence case in titlesMadeleine (ThinLinc team)2024-11-113-3/+3
| | | | The reason for this is to keep a consistency through out the project.
* Explicitly tag getHostAndPort() as inlinePierre Ossman2024-10-171-2/+2
| | | | | Otherwise the compiler will complain about a defined but unused static function.
* Merge branch 'errno' of github.com:CendioOssman/tigervncPierre Ossman2024-10-091-2/+2
|\
| * Split SystemException to handle WindowsPierre Ossman2024-10-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Windows has (at least) two error namespaces, both errno and GetLastResult(). These overlap, so it is important we keep track of which one we are dealing with. To make things extra problematic, the BSD socket API normally uses errno, but on Windows it has been mapped in to the GetLastResult() namespace. Try to keep better control of this by using separate classes for the namespaces.
* | More carefully release mouse buttons on closePierre Ossman2024-09-242-4/+4
|/ | | | | | | | | | | | | Only the client that currently has buttons pressed should actually send a release event as the client might not be currently in control of the pointer state. This is most clearly seen in a client that hasn't event authenticated properly yet. Approximate this from the server by using the last known server cursor position. It should hopefully not differ much from the last client provided position. Follow-up to 986280b382d57ef4f68d2d4afb13b26772e5acb0.
* Add more usage of SystemExceptionPierre Ossman2024-09-041-2/+3
| | | | | Prefer this exception for failures involving errno as it gives a better error description.
* Fix reporting of some TLS errorsPierre Ossman2024-09-042-22/+20
| | | | | These functions return a GnuTLS status, so we should use the correct exception for that so we get the proper error messages.
* Correctly handling rejecting server keyPierre Ossman2024-09-041-1/+1
| | | | | This is the user actively rejecting the connection, and should be signalled as such for correct behaviour.
* Add missing config.h includesPierre Ossman2024-09-045-0/+19
|
* Remove ConnFailedExceptionPierre Ossman2024-09-024-26/+22
| | | | | | | | There were more unclear usage of this exception class, and since nothing catches it it is very unclear what the purpose is. Go ahead and just remove it. Follow-up to bcaaea7.
* Correctly handle ZRLE cursorsPierre Ossman2024-08-301-2/+2
| | | | | | Cursor data has a depth of 32 bits and hence cannot use CPIXELs. This is a regression from baca73d.
* Move getUserPasswd()/showMsgBox() to CConnectionKang Lin2024-08-3013-122/+41
| | | | | Problems with the original code: A process can only establish one connection. After modification, multiple connections can be supported.
* H264Libav: Use nearest-neighbour sampling in scalerAndri Yngvason2024-08-221-1/+1
| | | | | | | | | | | sws_getCachedContext will set a default sampling method if 0 is passed to the flags argument. This means that when it is called again, the flags argument will not match the flags in the context, so a new one will be allocated every time. To get around this problem, we assign an explicit sampling method, one that also happens to be more efficient and just as good for this use-case as the default one, which is bicubic interpolation.
* H264Libav: Handle colour space conversionAndri Yngvason2024-08-191-0/+15
| | | | | The scaler is now informed of the colour space encoded into the stream so that it may do the proper conversion.
* Merge branch 'h264-buffer-size-fix' of https://github.com/any1/tigervncPierre Ossman2024-08-192-11/+19
|\
| * H264Libav: Clean up sws contextAndri Yngvason2024-08-161-0/+1
| | | | | | | | This fixes a memory leak
| * H264Libav: Use AVFrame for pixel format conversion bufferAndri Yngvason2024-08-162-11/+18
| | | | | | | | | | | | | | | | This ensures that the buffer is allocated with the correct alignment and padding for use with sws_scale. This fixes out-of-bounds writes which would in some cases cause segmentation faults and/or heap corruption.
* | Use proper gnutls_free() on WindowsPierre Ossman2024-08-132-10/+4
| | | | | | | | | | | | The underlying issue requiring this hack was fixed ages ago. Unfortunately, the fixed GnuTLS doesn't consider static linking. So we need to add a new hack that permits that.
* | Avoid using excessive namespacesPierre Ossman2024-08-136-16/+8
| | | | | | | | | | Try to be more clear about what things are external to the current context, and what aren't.
* | Avoid connection failed exceptionPierre Ossman2024-08-134-12/+12
| | | | | | | | | | The usage of this is unclear as it is never caught. Use the general exception class, to stay consistent with all other protocol handling.
* | Remove unused setPixelFormat() callbackPierre Ossman2024-08-122-12/+6
| | | | | | | | | | This was made obsolete in dd45b44 when we extended the serverInit() callback.
* | Update processMsg() descriptionPierre Ossman2024-08-122-12/+10
| | | | | | | | | | This method is no longer blocking, so the description needed to be adjusted.
* | Include key code for fake key eventsPierre Ossman2024-08-121-6/+6
| | | | | | | | Let's try to mimic a real event as much as possible to avoid bugs.
* | Better type for pointer button maskPierre Ossman2024-08-129-9/+9
| | | | | | | | | | This is a very limited bit field, so use an 8 bit type to clearly show how many bits are available.
* | Remove InputHandler interfacePierre Ossman2024-08-124-54/+32
| | | | | | | | | | The different uses of this interface are not that closely related and there is no need for them to have a common interface class.
* | Remove ScaleFiltersPierre Ossman2024-08-123-211/+0
| | | | | | | | This has been unused since 9fe3479.
* | Remove IdentityVerifier forward declarationPierre Ossman2024-08-121-1/+0
| | | | | | | | This class has been removed since ages.
* | Don't parse empty fence messagesPierre Ossman2024-08-121-1/+3
| | | | | | | | | | We need to return here or we'll do an out-of-bounds access on the data array.
* | Don't abuse auth failure exceptionPierre Ossman2024-08-0710-107/+130
| | | | | | | | | | | | | | | | This exception is for when the user fails to authenticate, not all possible errors that might occur during the authentication phase. Use more appropriate exception types for the various other problems that might occur, so that we can present things more accurately to the user.
* | Remove auth exception prefixPierre Ossman2024-08-076-13/+9
| | | | | | | | | | | | | | | | This prefix often just added noise, and could sometimes be added multiple times. It's better that user interface catch the specific exception type and give a more descriptive presentation to the user. This is partially a revert of 1922550.
* | Correctly handle cancelled authenticationPierre Ossman2024-08-071-10/+10
| | | | | | | | | | We should not be throwing up error messages, or asking to reconnect, if the user has actively cancelled the authentication attempt.
* | Avoid XKeysymToString() conflict with libX11Pierre Ossman2024-08-061-0/+3
|/ | | | | | | | | | | We implement our own version of this, and because of this we carry our lookup table generated by the same tool that libX11 uses. Unfortunately, that table is a global symbol and as such there might be a mismatch of which table should be used. Make sure we get our own copy by changing the name of it. We use a define rather than modifying ks_tables.h as that file is automatically generated.
* Add missing comma in default security type listPierre Ossman2024-07-291-1/+1
| | | | | Otherwise it merges with the next entry, removing both of them from the default list.
* H264Decoder: Fix context resetAndri Yngvason2024-07-221-1/+1
| | | | | This fixes a regression introduced by 12b3f4021641537b90727b23d42de5dff59006cd.
* Fix overflow; "Timer: gettimeofday is broken"Pierre Ossman2024-07-191-1/+4
| | | | | | The rounding misbehaved when the tv_usec calculation overflows. Fixes issue #1782.
* Be more careful with ComparingUpdateTracker pointerPierre Ossman2024-07-051-4/+13
| | | | | | As of 28c3f12, we might now be running the frame clock even without a framebuffer present. This means we need to be more careful accessing the ComparingUpdateTracker, as it might be NULL.
* Round up expiration time for timersPierre Ossman2024-07-051-1/+1
| | | | | Otherwise we won't properly guarantee that we'll wait *at least* as long as the specified time.
* Avoid shadowing variablesPierre Ossman2024-06-2433-84/+87
| | | | | It's a source of confusion and possibly bugs to reuse the same variable name for multiple things.
* Avoid redundant argumentsPierre Ossman2024-06-244-36/+34
| | | | | Remove redundant arguments where the method already has access to the relevant variable as an object attribute.
* Simplify code using range-based for loopsPierre Ossman2024-06-246-47/+35
| | | | | | | | | These are often more readable as they avoid a lot of the boilerplate of iterating over fixed arrays or STL containers. Note that this change is very conservative to avoid noise in "git blame". Only loops where this is a clear improvement have been converted.
* Remove careful client iteratationPierre Ossman2024-06-241-42/+24
| | | | | | | Clients cannot remove themselves from the list as we are iterating, so we don't need this complexity. If a client encounters a problem, it will only mark it self as closed and will be removed from the list at a later time.
* Prefer std::find() over manual searchPierre Ossman2024-06-245-47/+33
| | | | | Let's avoid reimplementing something basic that's available in the standard library. It also makes the code easier to read.
* Remove unnecessary headers from Security.cxxPierre Ossman2024-06-241-18/+1
|
* Mark overridden virtual functionsPierre Ossman2024-06-2449-280/+284
| | | | | Use the new "override" keyword to properly differentiate between new virtual methods, and existing virtual methods being overridden.
* Use nullptr in all C++ codePierre Ossman2024-06-2459-232/+248
| | | | | It's more readable than 0, and a bit safer than NULL, so let's try to follow modern norms.
* Merge branch 'present' of github.com:CendioOssman/tigervncPierre Ossman2024-06-1913-115/+173
|\
| * Slow down fake clock when no clientsPierre Ossman2024-06-191-11/+32
| | | | | | | | | | | | | | | | | | | | Run the frame clock at a slow 1 Hz if there are no clients connected. This is similar to what a normal X server does when the screen is blanked, and should keep applications waiting for the frame tick happy. Note that we still only keep the frame clock running if there is any application that are interested in it. Otherwise we still stop it completely.
| * Keep frame clock running if waiting for frame tickPierre Ossman2024-06-193-5/+19
| | | | | | | | | | | | | | | | | | | | | | If there is something interested in synchronizing to a frame tick, then keep the frame clock running, even if there are no updates. This is need mainly when something starts rendering, but also when something renders much slower than the frame clock (so it is essentially constantly "starting"). Such an application will not draw anything until it gets a new frame tick, which it won't get as the frame clock is waiting for something to start drawing.