summaryrefslogtreecommitdiff
path: root/SpiceXPI/src/plugin/controller.cpp
AgeCommit message (Collapse)AuthorFilesLines
2015-06-09Workaround firefox-gtk3 bugHEADmasterChristophe Fergeau1-0/+8
When it's built with gtk3, firefox plugin-container will use some LD_PRELOAD hack in order to be able to load the gtk2 flash plugin. However, this LD_PRELOAD'ed .so will cause gtk3 remote-viewer to crash when it's started by spice-xpi This commit just cleans up the unwanted LD_PRELOAD variable from the environment before starting remote-viewer.
2014-06-03controller: return immediately if already connectedMarc-André Lureau1-0/+2
Do not try again if the unix socket is already connected, but fail immediately. https://bugzilla.redhat.com/show_bug.cgi?id=1073461
2014-06-03controller: try connection every secondMarc-André Lureau1-2/+1
Currently, with 10 tries, it takes up to n(n+1)/2 = 55s before returning failure. The default firefox plugin timeout is 45s, passed that time, the plugin is killed. 10s should be enough in normal usage for the client to setup the unix socket. https://bugzilla.redhat.com/show_bug.cgi?id=1073461
2014-01-06Fix compilation with -Werror=format-securityPetter Reinholdtsen1-1/+1
The Debian package of spice-xpi failed to build on powerpc and sparc in Debian, failing with this error message: make[6]: Entering directory `/«PKGBUILDDIR»/SpiceXPI/src/plugin' CXX libnsISpicec_la-controller.lo controller.cpp: In destructor 'SpiceController::~SpiceController()': controller.cpp:73:5: error: format not a string literal and no format arguments [-Werror=format-security] cc1plus: some warnings being treated as errors The error is in a call to g_debug(G_STRFUNC). As this is a constant string, we can just replace the call with g_debug("%s", G_STRFUNC).
2013-03-25Add SpiceControllerWin classChristophe Fergeau1-0/+15
This class implements the controller interface for Windows/mingw.
2013-03-14Add an abstract controller base classChristophe Fergeau1-0/+260
It contains all the generic code, then platform-specific controller implementations will inherit from it and overload the non-generic parts abstract methods.
2013-03-14Rename controller.cpp to controller-unix.cppChristophe Fergeau1-194/+0
It mostly contain low-level controller/plugin communication code, and this is mainly non-portable code, let's rename this file to make this explicit. We will then add a controller.cpp file containing the generic code, and a controller-win.cpp file with the Windows specific code.
2013-03-01Move some preprocessor #define to configure.acChristophe Fergeau1-0/+2
They were hardcoded in CPPFLAGS in Makefile.am, having them in configure.ac makes things more obvious and more flexible.
2012-04-04Fix printf-format stringChristophe Fergeau1-1/+1
Use %z modifier for ssize_t variables, and for an uint32_t variable, the %l modifier shouldn't be neeeded.
2012-04-03check string length before calling strcpyPeter Hatina1-0/+2
2012-02-24Remove unused global variableMarc-André Lureau1-2/+0
2012-02-24Switch from log4cpp to glibMarc-André Lureau1-14/+7
GLib is used in the defacto library for desktop projects. It includes logging facilities that can be filtered by domain and level, and can be redirected or formated in various ways. Instead of pulling an extra large depedency for a small plugin, let's use what is common to the desktop. Afaict, nobody else is using log4cpp in Fedora. The configuration file is not user friendly. In comparison, you can just run "G_MESSAGES_DEBUG=SpiceXPI firefox" and easily modify logging via environment variable. There is no logging to file, and there is no configuration file. If you want to redirect to file, you can do so via redirection, or other mechanisms (ldpreload, environment..).
2011-06-07Fix compiler warningsspice-xpi-2.5Hans de Goede1-2/+2
2011-06-07Fix SpiceController::Connect sometimes returning success without connectingHans de Goede1-5/+1
SpiceController::Connect (the retry wrapper version) was using rc uninitialized, and if rc happened to be 0 it would return success without actually connecting. Also zap the check for a negative retry count if someone is stupid enough to do that we will never enter the loop and return the initial (now initialized to -1) rc value.
2011-04-27initPeter Hatina1-0/+203