aboutsummaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* Log TLS handshake resultPierre Ossman2018-10-092-1/+5
| | | | | Makes it easier to debug TLS issues, and to see the effect of altering the priority string.
* Restore original streams when terminating TLSPierre Ossman2018-09-214-2/+27
| | | | | | In theory we could return to communicate without TLS after a shutdown. It also makes sure the connection object isn't left completely without streams.
* Delete TLS streams before deleting the sessionPierre Ossman2018-09-214-33/+40
| | | | | | The streams depend on the session and can crash the program if they are removed in the wrong order. Do a general cleanup of the life time management of the streams.
* Strongly bind security objects to connection objectPierre Ossman2018-09-2130-93/+123
| | | | | There is already an implicit connection between them, so let's make it explicit. This allows easy lookup outside of the processMsg() function.
* Initialise CSecurityTLS::cert_cred properlyPierre Ossman2018-09-211-1/+1
| | | | | If we leave it at something random we'll get an invalid delete if the handshake fails.
* Remove destroy functionsPierre Ossman2018-09-214-4/+4
| | | | | These are just confusing and obfuscating. Do a normal delete of these objects instead.
* Estimate higher bandwidth in slow startPierre Ossman2018-09-211-2/+11
| | | | | | | If we are still in slow start then we haven't discovered the actual bandwidth limit yet. We also rely on the caller causing a bit of congestion to detect the limit. So report a higher bandwidth estimate than what we've currently tested in this scenario.
* Allow perceptually lossless refreshPierre Ossman2018-09-214-12/+36
| | | | | | | | | | | Loosen the definition of "lossless" a bit so that we can use high quality JPEG to refresh damaged parts of the screen. Although this isn't bit perfect, it is close enough that most users will not be able to tell the difference. Level 9 is used rather than level 8 because some monitors have exaggerated contrast that allows the artefacts from level 8 to be noticeable.
* Add method to get compression settings from encoderPierre Ossman2018-09-203-0/+10
|
* Don't force encoders to specify palette sizePierre Ossman2018-09-205-5/+5
| | | | | Most encoders don't have a palette mode, so don't force them to specify a dummy value to the Encoder base class constructor.
* Limit maximum lossless refresh CPU usagePierre Ossman2018-09-201-2/+7
| | | | | | If we have plenty of bandwidth then CPU might be the limiting resource. Unfortunately we don't have a good number for that limit, so add a conservative hard coded value.
* Don't attempt to send empty lossless refreshPierre Ossman2018-09-201-6/+9
| | | | | If we're out of time then we will definitely overshoot, so don't even try.
* Fix calculation of maximum lossless refresh areaPierre Ossman2018-09-201-0/+3
| | | | | The update size is in bytes, but we are counting pixels. So make sure we convert things properly before comparing.
* Avoid refresh of recently changed areasPeter Åstrand (astrand)2018-09-204-11/+80
| | | | | | | | If an area recently changed then we can guess that it will most likely change again very soon. In such a case it is meaningless to send a lossless refresh as it will directly be overwritten. Keep track of such areas and avoid refreshing them until we no longer see any changes to them.
* Fix bad reference in Timer::getRemainingMs()Pierre Ossman2018-09-201-1/+1
| | | | | The reference for "dueTime" wasn't properly updated when this code was refactored from a static method to a normal object method.
* Avoid compiler "use of uninitialised variable" warningsPierre Ossman2018-09-131-32/+33
| | | | | The compiler isn't smart enough to figure all of these out, so restructure things a bit to avoid warnings.
* Use system certificate trust storePierre Ossman2018-08-161-0/+3
| | | | | Makes it possible to use certificates from all popular CAs with TigerVNC.
* Avoid integer overflows in pixel size calculationsPierre Ossman2018-07-256-20/+23
|
* Fix bad type on congestion ETA variablePierre Ossman2018-07-171-1/+1
|
* Merge branch 'unix' of https://github.com/CendioOssman/tigervncPierre Ossman2018-05-298-224/+507
|\
| * Merge common socket codePierre Ossman2018-05-297-216/+255
| |
| * Remove unused code from socket classesPierre Ossman2018-05-295-109/+24
| |
| * Add support for Unix socketsPierre Ossman2018-05-293-1/+327
| | | | | | | | Patch originally by Dag-Erling Smørgrav for University of Oslo.
| * Use abstract SocketListener classPierre Ossman2018-05-043-8/+11
| | | | | | | | | | Makes the code more general and not directly tied to specifically TCP sockets.
| * Handle hexadecimal and octal parametersPierre Ossman2018-05-031-1/+1
| |
* | Catch exceptions by referencePierre Ossman2018-05-292-2/+2
| | | | | | | | | | We use polymorphic exception objects, so catching by value invokes the copy constructor and stuff that we don't really want.
* | Fix bad reference in TLSException initialiserPierre Ossman2018-05-291-1/+1
| |
* | Avoid assert crash after bytestream position wrap aroundPeter Åstrand (astrand)2018-05-291-2/+7
| | | | | | | | Fixes #652.
* | Avoid creating unused thread on single CPU machinesPeter Åstrand (astrand)2018-05-071-1/+7
| |
* | Flush pending changes when desktop startsPierre Ossman2018-05-071-2/+8
| | | | | | | | | | | | | | | | | | | | | | The system to avoid processing changes for a stopped desktop was a bit overly aggressive and resulted in those changes getting stuck even when the desktop started again (yet another change was needed to get things rolling again). Make sure we flush out anything pending once the desktop is back up and running. We don't use the frame timer here as we no longer know how old these changes are, so we're not really rate limiting any application.
* | Comparing ScreenSet:s should be done without considering orderPeter Åstrand (astrand)2018-05-071-3/+15
|/ | | | | | Avoids that a viewer connected to Xvnc sometimes disconnects with "Desktop configured a different screen layout than requested" when screens are changing.
* Merge branch 'alr' of https://github.com/CendioOssman/tigervncPierre Ossman2018-04-2013-93/+269
|\
| * Send lossless refresh even with pending updatesPierre Ossman2018-03-283-18/+29
| | | | | | | | | | | | There might be parts of the screen that haven't changed and can therefore be refreshed. Figure which parts these are and send just those.
| * Limit lossless refresh update to safe sizePierre Ossman2018-03-289-18/+73
| | | | | | | | | | | | We don't want to waste bandwidth on the lossless refresh if we might need that bandwidth for a normal update. Try to estimate how much data we can safely send without interfering.
| * Automatic lossless refreshPierre Ossman2018-03-285-20/+128
| | | | | | | | | | | | Resend pixel perfect copies of areas that were previously sent using a lossy encoder. This is done when there is no normal update to send, and no congestion.
| * Avoid checking updates when desktop is stoppedPierre Ossman2018-03-282-11/+18
| | | | | | | | | | | | | | | | No need to run all the update machinery when there is no client connected. This commit also cleans up the stop handling a bit by moving it to its own method.
| * Remove redundant Region::copyFrom()Pierre Ossman2018-03-284-7/+2
| | | | | | | | We already have an assignment operator, so no need for this method.
| * Respect request area for cursor renderingPierre Ossman2018-03-282-39/+39
| | | | | | | | | | | | | | We cannot send updates for a cursor that is outside the requested region, so make sure we track things properly. This also has the nice side effect of just re-sending the bits needed when the cursor overlaps a changed part of the framebuffer.
* | Remove no longer relevant license commentPierre Ossman2018-03-281-14/+0
| |
* | Stop abusing InputHandler class for write classPierre Ossman2018-03-282-11/+8
| | | | | | | | | | | | The handler is for incoming data and we should not be abusing that class for the writer class. Do proper write prototypes for the relevant functions.
* | Add missing break for LED state checkPierre Ossman2018-03-281-0/+1
|/ | | | | The previous code would incorrectly also add support for QEMU key events if LED state was supported.
* VNCServerST: Allow unsetting pixel buffer.Michal Srb2018-03-071-10/+6
| | | | | Originally calling VNCServertST::setPixelBuffer(PixelBuffer* pb_) with pb_=0 would do nothing. With this change pb will be set to 0 and deferred update timer will be stopped.
* Fix rounding error in pixel down conversionPierre Ossman2018-03-014-20/+26
| | | | | | Simple shifting can give noticable rounding errors if there is a large difference in the number of bits between the formats. Do the proper thing via a lookup table, the same way things are done for up conversion.
* Merge branch 'congestion' of https://github.com/CendioOssman/tigervncPierre Ossman2018-02-2611-219/+650
|\
| * Add crude congestion window debug tracePierre Ossman2017-11-173-0/+44
| | | | | | | | | | Allows us to compare our computed congestion window with the underlying one used by the TCP layer.
| * Add simple slow start to congestion controlPierre Ossman2017-11-172-22/+56
| |
| * Improved congestion control handlingPierre Ossman2017-11-176-118/+363
| | | | | | | | | | | | Refine the previous method by interpolating the values we need. This reduces the effect of the problem that we cannot send enough ping packets.
| * Move congestion control to its own classPierre Ossman2017-11-175-207/+292
| | | | | | | | | | It's a general function and it's better to have that particular complexity in its own place.
| * Reduce header dependencies in server classesPierre Ossman2017-11-175-13/+19
| |
| * Use a queue for congestion pingsPierre Ossman2017-11-172-16/+30
| | | | | | | | | | This reduces the data sent, and avoids any problems with the client corrupting it.