openresty / openresty/stream-lua-nginx-module
tcpsock:receive needs stream reading pattern
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 749
- Forks
- 210
- Avg merge
- 4h 31m
- Merged PRs (30d)
- 3
Description
Now tcpsock:receive now support two pattern '_a' and '_l'(default '*l' if pattern is nil), it's quite useful in text-based protocol or open binary protocol(eg. Mysql).
But to deal with non-public protocol, we need stream reading pattern, return anything once socket receives.
For example, we hava a decode library(.so/.dll) privided by others who don't open their protocol, and we need to fill socket data into the library to decode message out. Without steam reading pattern, decode can't be done in efficient way (done by tcpsock:receive(1) loop).
I suggest to add stream reading pattern into tcpsock:receive, especially in stream-lua-nginx-module
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the tcpsock:receive implementation and its existing _a, _l, and nil-pattern behavior in stream-lua-nginx-module. Compare how socket data is currently returned, then define the stream pattern so data is returned as soon as it is received; done means it supports the non-public protocol use case without a tcpsock:receive(1) loop.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, lua, nginx
- Domain
- api, networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100