summaryrefslogtreecommitdiff
path: root/SpiceXPI/src
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é Lureau2-0/+4
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 Reinholdtsen2-2/+2
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-04-17build: Use correct plugin name in Windows resource fileChristophe Fergeau1-1/+1
The nsISpicec -> npSpiceConsole rename was not propagated there.
2013-03-25Add glib Windows loggingChristophe Fergeau1-0/+46
As it's not very convenient to get logging output from the plugin while firefox is running, this commit adds a dumb glib logging implementation that writes the logging information to a file. As this is not efficient at all, it's disabled by default unless the SPICE_XPI_LOG_TO_FILE environment variable is set.
2013-03-25Add SpiceControllerWin classChristophe Fergeau5-0/+350
This class implements the controller interface for Windows/mingw.
2013-03-23Only export needed symbolsChristophe Fergeau2-1/+11
NPAPI plugins only need to have 3 symbols exported, make that explicit. This is also required when building Windows plugins as these symbols *must* be explicitly exported.
2013-03-23Rename plugin binary from libnsISpicec to npSpiceConsoleChristophe Fergeau1-8/+8
Windows Firefox expects the plugin filename to start with 'np' otherwise it won't pick it up as a plugin.
2013-03-23mingw: Add support for mingw buildChristophe Fergeau2-3/+54
Based on a patch from Nerijus Baliunas <nerijus@users.sourceforge.net>
2013-03-14Add an abstract controller base classChristophe Fergeau7-220/+407
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-14Use g_usleep in SpiceController::connect(int retries)Christophe Fergeau1-1/+1
g_usleep is more portable than sleep()
2013-03-14Add helper function to get client pathsChristophe Fergeau2-20/+60
The SPICE client paths will be different on Windows and Unix so add a helper function returning the paths to use to spawn the clients.
2013-03-14Add SpiceController::SetupControllerPipeChristophe Fergeau2-4/+13
Communication with the client is done differently on Windows and Linux (named pipe VS unix socket), so move this platform-specific setup to a distinct method.
2013-03-14Use glib functions to spawn/watch clientChristophe Fergeau2-66/+84
This removes quite a lot of OS-specific code.
2013-03-14Move StartClient() to the controller classChristophe Fergeau4-106/+130
This is platform specific, and is related to starting the receiver of controller messages, so let's move it with the rest of the platform-specific code.
2013-03-14Mark Controller::Connect() as privateChristophe Fergeau1-1/+1
It's only used internally, external code calls Connect(int retries)
2013-03-14Remove unused controller constructorChristophe Fergeau2-7/+0
2013-03-14Update copyright noticesChristophe Fergeau3-3/+6
2013-03-14Rename controller.cpp to controller-unix.cppChristophe Fergeau2-3/+1
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-14Use gio to write trust storeChristophe Fergeau2-33/+38
This has the big advantage of being portable, in addition to removing some code. Big disadvantage is that this adds a dependency on gio.
2013-03-12Split nsPluginInstance::connect a bitChristophe Fergeau2-74/+99
This makes it more readable, and moves OS-specific code to separate functions.
2013-03-12Make spice.xpi build optionalChristophe Fergeau1-1/+6
Now that we switched to using the headers from npapi-sdk to build the spice-xpi plugin, the only reason we are depending on xulrunner is to build an xpi package for the plugin for easier installation in firefox. However, this .xpi is not installed by default nor packaged by distributions, so it's not in wide use. This commit makes its build optional as this has the side-effect on making the xulrunner dependency optional as well, which is a good thing as xulrunner is huge and not necessarily available on all platforms we'd like to build spice-xpi on.
2013-03-08Switch to using npapi-sdk headers rather than XULChristophe Fergeau5-1/+1804
The main reason for us depending on xulrunner/libxul is to get the 4 headers defining NPAPI. Standalone headers are maintained at http://code.google.com/p/npapi-sdk/ , using them allows to drop a huge dependency on firefox code. This will make it easier to build spice-xpi on other platforms.
2013-03-08Don't try to use xpidlChristophe Fergeau1-8/+0
The xpidl binary is no longer available in xulrunner 10, so we no longer need the Makefile magic using xpidl now that we require it. We'll always directly use header.py/typelib.py instead.
2013-03-08Drop support for xulrunner < 1.9.1Christophe Fergeau3-19/+1
Even RHEL5 has at least xulrunner 10 these days, so no need to keep that compat code around.
2013-03-01Get rid of nspr useChristophe Fergeau4-53/+51
The only thing from nspr we use are typedef for bool, int32_t and definitions of TRUE/FALSE. Any decent C/C++ compiler should provide all of these. If this proves to be an issue, the NPAPI headers we use to build the plugin have a nptypes.h header with the needed defines for bool/true/false and int32_t.
2013-03-01Move some preprocessor #define to configure.acChristophe Fergeau8-2/+13
They were hardcoded in CPPFLAGS in Makefile.am, having them in configure.ac makes things more obvious and more flexible.
2013-03-01Remove unused xulrunner includesChristophe Fergeau1-15/+0
They are only used on non-Unix platforms, and we are only building the plugin for Unix at the moment. As we are trying to remove our dependencies on xulrunner, let's just remove these.
2013-02-28Remove #include <dlfcn.h>Christophe Fergeau1-1/+0
We are not dlopening anything.
2013-02-05Remove unused preprocessor symbolsChristophe Fergeau1-4/+0
2013-02-05Remove unused #includeChristophe Fergeau3-5/+1
We include some files from the XUL SDK which gives the impression that we are depending on some features from them, however they are actually not used at all, so let's remove them.
2013-02-05Remove unused XUL_* entries in CPPFLAGS/LIBADDChristophe Fergeau1-6/+0
2013-01-29xpi: add Proxy memberMarc-André Lureau5-1/+29
Set SPICE_PROXY environment variable accordingly.
2013-01-29xpi: use safer g_environ_setenv()Marc-André Lureau1-8/+11
Quoting GLib: Environment variable handling in UNIX is not thread-safe, and your program may crash if one thread calls g_setenv() while another thread is calling getenv(). (And note that many functions, such as gettext(), call getenv() internally.) This function is only safe to use at the very start of your program, before creating any other threads (or creating objects that create worker threads of their own). If you need to set up the environment for a child process, you can use g_get_environ() to get an environment array, modify that with g_environ_setenv() and g_environ_unsetenv(), and then pass that array directly to execvpe(), g_spawn_async(), or the like.
2013-01-29xpi: add a few g_environ functions from GLib >= 2.28Marc-André Lureau4-0/+240
2012-12-10fix issues in ScriptablePluginObject::SetPropertyFederico Simoncelli1-3/+9
2012-12-10support smaller NPNetscapeFuncs tablesFederico Simoncelli1-47/+5
2012-11-20bump max. firefox versionPeter Hatina1-1/+1
2012-07-16validate tcp port valuesPeter Hatina1-2/+29
2012-07-10update rdf versions - plugin, firefoxPeter Hatina1-2/+2
2012-07-04add missing IDL attributesPeter Hatina1-0/+2
2012-05-09SetSSLChannels: add ssmartcard, susbredir, stunnelAlon Levy1-1/+2
Adding some more channels to the RHEL 5 list. The longer winded story is that ovirt-engine passes us those values because vdsm unconditionally removes the first letter of every channel name in the secure channels list (aka SSLChannels here). Instead of changing vdsm, and dealing with multiple vdsm versions for each cluster, a huge PITA, let spice-xpi parse some extra channel names. RHBZ: 790416
2012-05-03fix signal handling when disconnectingPeter Hatina1-1/+3
2012-04-23remove leading 's' from all spice channel namesPeter Hatina1-9/+15
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-04Remove unused SendWStr()Christophe Fergeau2-16/+0
2012-04-04Change SendStr to handle a std::stringChristophe Fergeau2-15/+15
All callers were using std::string::c_str(), better to move this call to SendStr instead of doing it everywhere.
2012-04-04Move secure channel fixup to secure channel setterChristophe Fergeau1-15/+14
The secure channel names need to be fixed for compatibility with older spice versions. However, it's better to do it directly when m_secure_channels is set rather than waiting until its first use
2012-04-04Handle USB-related plugin propertiesChristophe Fergeau2-10/+10
The Firefox plugin exposes the UsbAutoShare property and the SetUsbFilter method that were not wired until now. This commit propagates their value to the nsPluginInstance object and send them through the controller socket.