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

Write number of bytes rather than number of characters #2

Closed
wants to merge 1 commit into from

Conversation

dwoos
Copy link

@dwoos dwoos commented Jul 7, 2018

This should fix uwplse/oddity#22.

@@ -105,7 +105,7 @@ private void sendJson(String json) throws IOException {
System.out.println(json);
}

out.writeInt(json.length());
out.writeInt(json.getBytes().length());
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.length since it's an array :-)

@emichael
Copy link
Owner

emichael commented Jul 8, 2018

Unfortunately doesn't work. Now, the server hangs, probably because the number of bytes is somehow over-reported? Maybe we need to specify the charset in .getBytes?

You should be able to test yourself using lab 0.

./run-tests.py -l3 -d 3 1 "APPEND:foo:¬bar"

@emichael
Copy link
Owner

That should be ./run-tests.py -l0 -d 3 1 "APPEND:foo:¬bar"

@emichael emichael closed this in 9050592 Feb 27, 2019
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

Successfully merging this pull request may close these issues.

Doesn't handle non-ASCII characters in JSON strings
2 participants