stream-lua-nginx-module
stream-lua-nginx-module copied to clipboard
ngx.socket.tcp receive bsd style
Implement bsd style receive('*b') for ngx.socket.tcp, and add a simple test case in file t/137-tcp-socket-receive-bsd-style.t
春哥好,今天看到openresty邮件列表里面有关于BSD风格的receive的讨论,我印象中关于这个主题在邮件列表里面已经多次出现了。因此一时兴起写了实现了这个接口,并附上一个简单的测试文件(对Test::Nginx的语法还不完全了解,所以只写一个最简单的test case)。目前还没有去在openresty的文档中添加使用方法,如果这个PR被接受,我再去补充文档,到时候再提交一个PR。英文学得不好,表达不够native,因此前面仅用一段简单的英语做描述,不知道是否符合规范?希望能得到春哥的指点,谢谢。
@brg-liuwei Seems like your branch fails the Travis CI testing:
https://travis-ci.org/openresty/stream-lua-nginx-module/builds/156263654
And also see below in this ticket's web UI.
Your branch does not even compile. Will you fix that first?
@brg-liuwei It is useful and it works well, thank you. Do you mind making another pull request to lua-nginx-module ? I'd like to see cosocket in http supporting bsd style receive.
@mike07026 Ok, I'm very glad to make another PR to lua-nginx-module. I will accomplish it soon, please wait a moment.
@doujiang24 @cuiweixie @yangshuxin Will you have a look at this for me? Many thanks!
I have used the api tcpsock:receive('*b') on the repo lua-resty-socks5-server and works well for socks5 server until now:)
when will those PRs to be merged to master? @agentzh @brg-liuwei
when will those PRs to be merged to master? @agentzh :)
@brg-liuwei I suggest adding this feature to ngx_http_lua_module first since we usually sync changes in only one direction (i.e., from ngx_http_lua to ngx_stream_lua), not both :)
Oops! it seems that the #refactor# break all pull codes. @brg-liuwei
Why didn't I find *b parameter in v0.0.6rc3 version? @brg-liuwei
I think we are going for the receive_any() route now? @spacewander What's your plan please?
I will port the receive_any() from the lua-nginx-module once I have free time.