-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix miscalculation of rlen #3
Conversation
M(metaend, "EN\r\n", MCMC_RESP_META, MCMC_CODE_END, MCMC_OK, 0) | ||
M(metaexists, "EX\r\n", MCMC_RESP_META, MCMC_CODE_EXISTS, MCMC_OK, 0) | ||
M(metaok, "HD\r\n", MCMC_RESP_META, MCMC_CODE_OK, MCMC_OK, 0) | ||
M(metaok2, "HD O123 C123\r\n", MCMC_RESP_META, MCMC_CODE_OK, MCMC_OK, 11) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new test
M(metanotfound, "NF\r\n", MCMC_RESP_META, MCMC_CODE_NOT_FOUND, MCMC_OK, 0) | ||
M(metanotstored, "NS\r\n", MCMC_RESP_META, MCMC_CODE_NOT_STORED, MCMC_OK, 0) | ||
M(metavalue, "VA 2 t\r\nhi\r\n", MCMC_RESP_META, MCMC_CODE_OK, MCMC_OK, 3) // FIXME: does this make sense? | ||
M(metavalue2, "VA 2\r\nho\r\n", MCMC_RESP_META, MCMC_CODE_OK, MCMC_OK, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is 0 not 2 due to the else
if (more) {
r->rline = cur+1; // eat the space.
r->rlen = l-1;
} else {
r->rline = NULL;
r->rlen = 0;
}
So I ran into this (the rline being wrong with meta) with mcshredder this week. For meta the rline was supposed to be where the flags start, but I'm not sure that actually made sense anymore. So I need to make a decision on how it should be properly calculated, I think. |
Agreed, why can't just return the entire result line, which is how I understand |
It probably just needs to be two functions; one for getting the meta flags line and one for "full response line". I'm not sure I have the brainpower to make this decision today though. The problem is mcmc is a core client library, so "where do the meta flags start?" is a legitimate question for a client builder. |
Sounds good. We don't use line() in our Lua, so take you time. |
cripes. took more than a year to circle back to this. what a nightmare. I've got this fixed a different way the branch that I'm working on, so I'll close this out. I refactored to remove |
No description provided.