Bug 40537 - Make dependency on libsoup optional
Summary: Make dependency on libsoup optional
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: gabble (show other bugs)
Version: git master
Hardware: Other All
: medium enhancement
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL: http://cgit.freedesktop.org/~zabaluev...
Whiteboard: review+
Keywords: patch
Depends on:
Blocks:
 
Reported: 2011-09-01 01:33 UTC by Mikhail Zabaluev
Modified: 2011-10-12 03:45 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Zabaluev 2011-09-01 01:33:45 UTC
telepathy-gabble has a dependency on libsoup, which is used only for the special case of allocating Jingle proxies for Google Talk.
For small platform installations where Jingle calls are not a major use case, this dependency becomes an outlier.

The proposed patch makes Google relay support, along with the libsoup dependency, optional.
Comment 1 Danielle Madeley 2011-09-01 01:40:00 UTC
 #ifdef ENABLE_GOOGLE_RELAY
-
   tp_clear_object (&self->soup);
+#endif

Unrequired ifdef. self->soup == NULL.

It would be nice to squash these commits.

+static RelaySessionData *
+relay_session_data_new (guint requests_to_do,
+                        GabbleJingleFactoryRelaySessionCb callback,
+                        gpointer user_data)

+static void
+translate_relay_info (GPtrArray *relays,
+                      const gchar *relay_ip,
+                      const gchar *username,
+                      const gchar *password,
+                      const gchar *static_type,
+                      const gchar *port_string,
+                      guint component)

+static void
+on_http_response (SoupSession *soup,
+                  SoupMessage *msg,
+                  gpointer user_data)

+void
+gabble_google_relay_resolver_resolve (GabbleGoogleRelayResolver *self,
+                                      guint components,
+                                      const gchar *server,
+                                      guint16 port,
+                                      const gchar *token,
+                                      GabbleJingleFactoryRelaySessionCb callback,
+                                      gpointer user_data)

Not in Telepathy style.

As mentioned, it would be nice to make this a GIO-style function, but I don't think that's a blocker.
Comment 2 Mikhail Zabaluev 2011-09-01 02:00:45 UTC
(In reply to comment #1)
>  #ifdef ENABLE_GOOGLE_RELAY
> -
>    tp_clear_object (&self->soup);
> +#endif
> 
> Unrequired ifdef. self->soup == NULL.

soup is not declared in the no-relay case.
I don't think shifting the delta to the structure declaration by defining a dummy GObject *soup member would improve the code much.

> It would be nice to squash these commits.

Done (please force-pull your local branches if any).

> +static RelaySessionData *
> +relay_session_data_new (guint requests_to_do,
> +                        GabbleJingleFactoryRelaySessionCb callback,
> +                        gpointer user_data)
> 
> +static void
> +translate_relay_info (GPtrArray *relays,
> +                      const gchar *relay_ip,
> +                      const gchar *username,
> +                      const gchar *password,
> +                      const gchar *static_type,
> +                      const gchar *port_string,
> +                      guint component)
> 
> +static void
> +on_http_response (SoupSession *soup,
> +                  SoupMessage *msg,
> +                  gpointer user_data)
> 
> Not in Telepathy style.

I copied most of these from older code :) OK, indented properly now.
Comment 3 Mikhail Zabaluev 2011-09-01 03:29:07 UTC
(In reply to comment #2)
> I don't think shifting the delta to the structure declaration by defining a
> dummy GObject *soup member would improve the code much.

In fact, it would, because an empty structure is not too good either.
Fixed:
http://cgit.freedesktop.org/~zabaluev/telepathy-gabble/commit/?h=soup-is-optional&id=28b64163e8bbca02de308612f6653ed291e2b1df
Comment 4 Will Thompson 2011-09-26 09:13:30 UTC
Merged to master: thanks! http://cgit.freedesktop.org/telepathy/telepathy-gabble/commit/?id=6211097
Comment 5 Mikhail Zabaluev 2011-10-11 11:14:01 UTC
I had to record another patch to disable tests in jingle/stun-server.py which use Google Relay.
Again, offered here:
http://cgit.freedesktop.org/~zabaluev/telepathy-gabble/log/?h=soup-is-optional
Comment 6 Danielle Madeley 2011-10-11 14:59:16 UTC
(In reply to comment #5)
> I had to record another patch to disable tests in jingle/stun-server.py which
> use Google Relay.
> Again, offered here:
> http://cgit.freedesktop.org/~zabaluev/telepathy-gabble/log/?h=soup-is-optional

++
Comment 7 Mikhail Zabaluev 2011-10-12 03:45:15 UTC
Thanks, merged to master.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.