Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]The definition of LF, EOL, NULL_BYTE is wrong #8

Open
gokoushiro opened this issue Jun 20, 2016 · 3 comments
Open

[BUG]The definition of LF, EOL, NULL_BYTE is wrong #8

gokoushiro opened this issue Jun 20, 2016 · 3 comments

Comments

@gokoushiro
Copy link

In rabbitmqstomp.lua:
local LF = "\x0a"
local EOL = "\x0d\x0a"
local NULL_BYTE = "\x00"

However, they do not work properly.
They should be:

local LF = "\n"
local EOL = "\r\n"
local NULL_BYTE = "\0"

@suchitpuri
Copy link

Hi @gokoushiro thanks for raising the issue, the above configuration has been working for us and others for quite some time now.

Is there a way you can tell us how to reproduce this issue or some code sample where this might fail.

@gokoushiro
Copy link
Author

On my vmware Ubuntu 16.04 , openresty 1.9.4.7 with lua5.1,
I cannot connect to the rabbitmq-server in my lua script, always got "timeout".
And then I found when connecting to the rabbitmq-server, in function _build_frame I got "CONNECTx0dx0aaccept-version:1.2x0dx0ahost:/x0dx0alogin:guestx0dx0apasscode:guestx0dx0ax0dx0ax00x0dx0a"
The escape character "\x" seems not working. But when I change them, the connecting succeed.

@Loc-Tran
Copy link

I also ran into this issue where the \x .. characters were also not converting to their proper encoding equivalents. It may be related to environment issues such as different Lua versions and settings so I've made changes here (mainly in the escaped characters constants and changes to the build_frame function) such that it should work for version 5.1.

If you have the same issue as described above, try my lua script at
https://github.com/Loc-Tran/lua-resty-rabbitmqstomp

I was notably using Openresty in CentOS as well so it might be related to that too...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants