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.
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?
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!
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.
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?
ChangesShould be fixed in https://hg.prosody.im/0.11/rev/413bd21ba449 (and its parent) Please test the fix :)
ChangesConfirmed 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!