#1598 Missing dbuffer length

Reporter Lance Stout
Owner Zash
Created
Updated
Stars ★ (1)
Tags
  • Priority-Medium
  • Status-Fixed
  • Type-Defect
  • Milestone-0.11
  1. Lance Stout on

    What steps will reproduce the problem? 1. Use lua 5.1 2. Create a dbuffer instance, write some data to it 3. Run #dbuffer_instance and dbuffer_instance:length() What is the expected output? The two lengths should be the same. What do you see instead? The # version returns 0, the :length() version returns the expected length. What version of the product are you using? On what operating system? prosody-trunk, ubuntu 18.04, lua5.1 Please provide any additional information below. Using lua5.2 or lua5.3 the dbuffer metatable length is working. Did trunk drop 5.1 support? Encountered this because websocket connections stopped responding, no frames being parsed since they appeared to be 0 length.

  2. Zash on

    Thanks for the report! This is indeed a problem since util.dbuffer was backported to 0.11. There's not that much we can do about the behavior of # in Lua 5.1, other than switch everything to :len() or ... :length() Lua 5.1 is still supported. However, Lua 5.2 is the recommended version for Prosody 0.11.x and it's been the idea that 0.12.x would recommend Lua 5.3. Curious why you're running trunk on Lua 5.1 in the first place?

    Changes
    • tags Milestone-0.11 Status-Accepted
  3. Zash on

    Changes
    • owner Zash
    • tags Status-Started
  4. Zash on

    Should be fixed in https://hg.prosody.im/0.11/rev/413bd21ba449 (and its parent) Please test the fix :)

    Changes
    • tags Status-Fixed
  5. Lance Stout on

    Confirmed fixed. Had trunk running against 5.1 because the Dockerfile I was using was made back when 0.11 was trunk :| I've now updated that, but this was the first time there was ever an issue. Thanks!

New comment

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