#1096 bosh error

Reporter Victor Seva
Owner Nobody
Created
Updated
Stars ★ (1)
Tags
  • Type-Defect
  • Priority-Medium
  • Status-New
  1. Victor Seva on

    On version 0.10 I saw this kind of errors: Mar 08 15:08:46 bosh1677c504-debb-4e8c-896e-7221b324e508 info Authenticated as 204-uctest@localhost Mar 08 15:08:46 bosh1677c504-debb-4e8c-896e-7221b324e508 info BOSH client disconnected Mar 08 15:08:46 http.server error Traceback[httpserver]: /usr/lib/prosody/modules/mod_bosh.lua:270: attempt to compare nil with number stack traceback: [C]: in function 'parse' /usr/lib/prosody/util/xmppstream.lua:271: in function 'feed' /usr/lib/prosody/modules/mod_bosh.lua:136: in function '?' /usr/lib/prosody/util/events.lua:78: in function </usr/lib/prosody/util/events.lua:74> (tail call): ? /usr/lib/prosody/net/http/server.lua:239: in function </usr/lib/prosody/net/http/server.lua:180> (tail call): ? [C]: in function 'xpcall' /usr/lib/prosody/net/http/server.lua:112: in function 'process_next' /usr/lib/prosody/net/http/server.lua:128: in function 'success_cb' /usr/lib/prosody/net/http/parser.lua:177: in function 'feed' /usr/lib/prosody/net/http/server.lua:159: in function 'onincoming' /usr/lib/prosody/net/server_event.lua:608: in function </usr/lib/prosody/net/server_event.lua:557> [C]: in function 'loop' /usr/lib/prosody/net/server_event.lua:751: in function </usr/lib/prosody/net/server_event.lua:750> [C]: in function 'xpcall' /usr/bin/prosody:400: in function 'loop' /usr/bin/prosody:431: in main chunk [C]: ?

  2. Victor Seva on

    relevant code: https://github.com/bjc/prosody/blob/master/plugins/mod_bosh.lua#L297-L303 Example of the logic: local wait, rid = nil,true local attr = {} if not rid or (not wait and attr.wait or wait < 0 or wait % 1 ~= 0) then ok = true end lua: /tmp/t.lua:4: attempt to compare nil with number stack traceback: /tmp/t.lua:4: in main chunk [C]: ?

  3. Victor Seva on

    related? https://prosody.im/issues/343

  4. Victor Seva on

    I think this logic: if not rid or not wait or wait < 0 or wait % 1 ~= 0 then is good enough here, since: local rid = tonumber(attr.rid); local wait = tonumber(attr.wait); so attr.wait == nil => wait == nil

  5. Zash on

    I think that's meant to be "if the wait attribute was included, but it was not a positive integer". It's optional, so it's fine if it's missing, but if it's included it should be an unsigned short integer, according to the non-normative schema.

New comment

Not published. Used for spam prevention and optional update notifications.