[Spice-devel] [PATCH spice-gtk 2/2] Add SpiceSession:proxy
Christophe Fergeau
cfergeau at redhat.com
Tue Jan 29 02:36:54 PST 2013
On Mon, Jan 28, 2013 at 09:19:33PM +0100, Marc-André Lureau wrote:
> Add a session property to set proxy setting, since it is racy to rely
> on setenv(). Also doing so would override system environment, which
> will modify other session too sharing the same process.
> ---
> gtk/spice-proxy.c | 10 ++++++++++
> gtk/spice-proxy.h | 1 +
> gtk/spice-session.c | 54 ++++++++++++++++++++++++++++++++++++++++-------------
> 3 files changed, 52 insertions(+), 13 deletions(-)
>
> diff --git a/gtk/spice-proxy.c b/gtk/spice-proxy.c
> index 97c3a6b..2182f33 100644
> --- a/gtk/spice-proxy.c
> +++ b/gtk/spice-proxy.c
> @@ -234,3 +234,13 @@ static void spice_proxy_class_init(SpiceProxyClass *klass)
> G_PARAM_STATIC_STRINGS |
> G_PARAM_READWRITE));
> }
> +
> +gchar* spice_proxy_to_string(SpiceProxy* self)
> +{
> + SpiceProxyPrivate *p;
> +
> + g_return_val_if_fail(SPICE_IS_PROXY(self), NULL);
> + p = self->priv;
> +
> + return g_strdup_printf("%s://%s:%u", p->protocol, p->hostname, p->port);
Oh, forgot to ask if p->protocol and p->hostname can be NULL there, and if
we need g_return_val_if_fail checks for these?
Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20130129/c32e3e34/attachment.pgp>
More information about the Spice-devel
mailing list