Summary: | Connect example doesn't initialize WockyXmppNode | ||
---|---|---|---|
Product: | Wocky | Reporter: | Cosimo Cecchi <cosimoc> |
Component: | General | Assignee: | Will Thompson <will> |
Status: | RESOLVED FIXED | QA Contact: | Telepathy bugs list <telepathy-bugs> |
Severity: | normal | ||
Priority: | medium | Keywords: | patch |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
URL: | http://git.collabora.co.uk/?p=user/wjt/wocky.git;a=commitdiff;h=refs/heads/call-init-in-connect-example | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Cosimo Cecchi
2009-11-09 02:18:22 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()? 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. (changing the branch name; i have more trivia coming up.) 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.