Bug 24994 - Connect example doesn't initialize WockyXmppNode
Summary: Connect example doesn't initialize WockyXmppNode
Status: RESOLVED FIXED
Alias: None
Product: Wocky
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Will Thompson
QA Contact: Telepathy bugs list
URL: http://git.collabora.co.uk/?p=user/wj...
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2009-11-09 02:18 UTC by Cosimo Cecchi
Modified: 2010-11-30 13:40 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Comment 1 Simon McVittie 2010-03-09 09:43:42 UTC
 200   if (strcmp (stanza->node->name, "features")
 201       || strcmp (wocky_xmpp_node_get_ns (stanza->node), WOCKY_XMPP_NS_STREAM))
 202     {
 203       printf ("Didn't receive features stanza\n");
 204       g_main_loop_quit (mainloop);
 205       return;
 206     }
 207 
 208   wocky_xmpp_node_init ();

Why is w_x_n_i only called after we've already interacted with stanza->node?

Shouldn't construction of any WockyXmppStanza implicitly initialize WockyXmppNode?

Or, if w_x_n_i is a mandatory initialization function like g_type_init (but: ugh), shouldn't it be called from main()?
Comment 2 Will Thompson 2010-11-20 03:33:07 UTC
examples/connect.c was ‘fixed’ ages ago in <http://git.collabora.co.uk/?p=wocky.git;a=commitdiff;h=d0977e8aed68ec2169534c35e396b6be0df4146c>, but the fix is obviously incorrect: it only initializes Wocky in one branch of the example program. Hence, running it in 'connector' mode works, but running it in 'raw' mode does not.

The attached trivial patch actually fixes this bug.
Comment 3 Will Thompson 2010-11-20 03:44:54 UTC
(changing the branch name; i have more trivia coming up.)
Comment 4 Will Thompson 2010-11-30 13:40:17 UTC
Sjoerd reviewed this IRL.


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.