Bug 34975

Summary: porter should have a fallback for no IQ handlers
Product: Wocky Reporter: Jonny Lamb <jonny.lamb>
Component: GeneralAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium Keywords: patch
Version: unspecified   
Hardware: Other   
OS: All   
URL: http://cgit.collabora.com/git/user/wjt/wocky/diff/?id=refs/heads/reply-to-unhandled-iqs
Whiteboard: review+
i915 platform: i915 features:
Bug Depends on: 33911    
Bug Blocks:    

Description Jonny Lamb 2011-03-03 06:52:34 UTC
Gabble has this:

>  /* FIXME: the porter should do this for us. */
>  wocky_porter_register_handler_from_anyone (priv->porter,
>      WOCKY_STANZA_TYPE_IQ, WOCKY_STANZA_SUB_TYPE_NONE,
>      WOCKY_PORTER_HANDLER_PRIORITY_MIN,
>      iq_unknown_cb, conn, NULL);

iq_unknown_cb does this:

>  wocky_stanza_get_type_info (stanza, NULL, &subtype);
>
>  switch (subtype)
>    {
>    case WOCKY_STANZA_SUB_TYPE_GET:
>    case WOCKY_STANZA_SUB_TYPE_SET:
>      _gabble_connection_send_iq_error (conn, stanza,
>           XMPP_ERROR_SERVICE_UNAVAILABLE, NULL);
>       return TRUE;
>     default:
>       break;
>     }
> 
>   return FALSE;

The porter should do this for us instead of just not replying to IQs.
Comment 1 Will Thompson 2011-03-10 02:20:44 UTC
I began implementing this in Wocky, but hit weird test failures. The WIP patch is at <http://git.collabora.co.uk/?p=user/wjt/wocky.git;a=commitdiff;h=refs/heads/reply-to-unhandled-iqs>. From the commit message:

XMPP Core requires that we reply to all IQs we receive. If no handler
claims responsibility for an incoming IQ, the porter should send back a
<service-unavailable/> error. (Currently, Gabble does this.)

For reasons I don't pretend to fully understand, this currently doesn't
work! The test this patch adds fails with:

    ERROR:../../tests/wocky-test-helper.c:233:wait_sched_close_cb: assertion
    failed (error == (wocky-xmpp-connection-error, 1)): Another receive
    operation is pending (g-io-error-quark, 20)

And, worringly, /xmpp-porter/handler-stanza fails with an equally
inexplicable assertion:

    ERROR:../../tests/wocky-test-helper.c:230:wait_sched_close_cb: assertion
    failed: (s == NULL)

I think this may be related to bug 34308 which I found when writing a simple
send-a-message example program…
Comment 2 Will Thompson 2012-01-31 06:58:30 UTC
It works!
Comment 3 Will Thompson 2012-01-31 07:25:05 UTC
I made Gabble use this: http://cgit.collabora.com/git/user/wjt/telepathy-gabble/log/?h=unhandled-iqs

For reasons of laziness, this branch is atop the deloudmouthing stuff.
Comment 4 Simon McVittie 2012-01-31 07:57:37 UTC
This looks good, conditional on the de-loudmouthing (which I started looking at and liked the look of so far, but then decided reviewing Jonny's spec stuff was probably higher-priority).
Comment 5 Jonny Lamb 2012-01-31 09:27:22 UTC
Yeah I can get behind both of these branches.
Comment 6 Will Thompson 2012-11-06 16:32:04 UTC
this has been in wocky (commit 43d93377f) for ages, and in Gabble since 0.15.4 (commit de0f8a21f8).

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.