baiwyc119 / lxmppd

Automatically exported from code.google.com/p/lxmppd
0 stars 0 forks source link

Traceback for nil host with spectrum2 roster #493

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Export an existing roster from Openfire when using Spectrum2 and import it 
into prosody using the script from this page 
http://jontai.me/blog/2011/11/openfire-to-prosody/ (may require editing the 
generated roster to fix escaped characters)
2. Start prosody
3. Connect to the aim spectrum 2 service

What is the expected output? What do you see instead?

The following error is logged and no AIM (or other) spectrum2 users will show 
up in the client roster:
Apr 23 09:11:09 mod_c2s error   Traceback[c2s]: 
/usr/lib/prosody/core/rostermanager.lua:203: attempt to concatenate local 
'host' (a nil value)
stack traceback:
    /usr/lib/prosody/core/rostermanager.lua:203: in function </usr/lib/prosody/core/rostermanager.lua:201>
    (tail call): ?
    /usr/lib/prosody/modules/mod_pep.lua:122: in function '?'
    /usr/lib/prosody/util/events.lua:67: in function 'fire_event'
    /usr/lib/prosody/core/stanza_router.lua:187: in function 'core_post_stanza'
    /usr/lib/prosody/modules/mod_presence.lua:89: in function 'handle_normal_presence'
    /usr/lib/prosody/modules/mod_presence.lua:325: in function '?'
    /usr/lib/prosody/util/events.lua:67: in function 'fire_event'
    /usr/lib/prosody/core/stanza_router.lua:187: in function 'core_post_stanza'
    /usr/lib/prosody/core/stanza_router.lua:135: in function </usr/lib/prosody/core/stanza_router.lua:56>
    ...
    [C]: in function 'parse'
    /usr/lib/prosody/util/xmppstream.lua:255: in function 'feed'
    /usr/lib/prosody/modules/mod_c2s.lua:230: in function 'data'
    /usr/lib/prosody/modules/mod_c2s.lua:252: in function </usr/lib/prosody/modules/mod_c2s.lua:249>
    (tail call): ?
    /usr/lib/prosody/net/server_select.lua:854: in function </usr/lib/prosody/net/server_select.lua:836>
    [C]: in function 'xpcall'
    /usr/bin/prosody:376: in function 'loop'
    /usr/bin/prosody:407: in main chunk
    [C]: ?

What version of the product are you using? On what operating system?
0.9.8 (via. packaging system) on ubuntu 14.04
remote roster module from the prosody modules project
spectrum2 2.0.0-beta2

Please provide any additional information below.
The following patch will allow the remote roster to be received, but doesn't 
explain why a nil username and host are being passed to is_contact_subscribed().

--- core/rostermanager.lua.orig 2015-04-23 09:14:35.401114044 -0700
+++ core/rostermanager.lua  2015-04-23 09:12:39.333485833 -0700
@@ -200,6 +200,12 @@
 end
 function is_contact_subscribed(username, host, jid)
    do
+       if username == nil then
+           username = ''
+       end
+       if host == nil then
+           host = ''
+       end
        local selfjid = username.."@"..host;
        local subscription = _get_online_roster_subscription(selfjid, jid);
        if subscription then return (subscription == "both" or subscription == "from"); end

Original issue reported on code.google.com by wwwdr...@gmail.com on 23 Apr 2015 at 6:22