Comments (4)
Checking for an invalid number of arguments (e.g. 0 for mget, odd for mset, etc.) is probably doable.
For redis, mget is well-formed (an array *1
with 1 element that's the command name and 0 args), for memcached, get with 0 arguments is not allowed by the protocol but also sending ERROR
there may work.
Retrieval command:
------------------
The retrieval commands "get" and "gets" operate like this:
get <key>*\r\n
gets <key>*\r\n
- <key>* means one or more key strings separated by whitespace.
» telnet 127.0.0.1 11211
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
get
ERROR
get k
END
from twemproxy.
hello, I made a brief modification. When the number of parameters does not match, an error is returned. When a tcp connection is working normally, it will not be actively closed by the proxy, even if a command that does not conform to the rules is sent.
Do you think this can be merged into the master branch?
from twemproxy.
That seems right and I'd probably merge that if I don't find anything else during the review (and the CLA is signed) - it also needs to handle auth in the reply code.
if (r->type == MSG_REQ_REDIS_AUTH && array_len(r->keys) > 0) {
is what it should be, I think, see redis_handle_auth_req
127.0.0.1:6379> auth
(error) ERR wrong number of arguments for 'auth' command
from twemproxy.
This seems to be a very bad implementation. 囧
from twemproxy.
Related Issues (20)
- Invalid argument when hmset HOT 1
- Cross Region Replication Support HOT 1
- Monotonically Increasing CPU usage for redis proxy HOT 3
- Twemproxy does not release memory for mbufs: Free list garbage collection approach HOT 1
- Not working redis-sentinel-feature HOT 2
- Building release 0.5.0 on OpenBSD 7.0 fails with `ld: error: undefined symbol: backtrace` HOT 1
- we have Redis Cluster ,what's twemproxy usage for Redis now?
- add HRANDFIELD HOT 5
- twemproxy支持blpop指令么? HOT 2
- Question: Can we pass/upload configuration file through web browser?
- error logs: NC_ request HOT 2
- possible bug in slots count reported in verbose logging statement HOT 1
- Q: still copy after each msg_parsed?? HOT 1
- memcached replication (with consistant hash) HOT 2
- Do not ship/install "test_all"
- Murmur implementation is not endian/alignment-neutral
- Getting error "" Redis connection lost and commands aborted in uncertain state. They might have been processed."'
- nutcracker sets umask only upon daemonization HOT 1
- fuzzing integration in oss-fuzz HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twemproxy.