Stomp content-length header should be in bytes #315

merged 1 commit into from Feb 28, 2013


None yet
2 participants

In 1.9.x String#size doesn't return the number of bytes, but the number of characters. The Stomp protocol wants the number of bytes in the content-length header. Using String#size falls down when there are multibyte characters. I updated the header to use bytesize when it's available matching the form in EM::Connection#send_data.

It is recommended that SEND frames include a content-length header which is a byte count for the length of the message body."

I wasn't sure the best way to write a test for it. I'd be happy to update the test if given advice.

tmm1 added a commit that referenced this pull request Feb 28, 2013

Merge pull request #315 from tjsingleton/master
Stomp content-length header should be in bytes

@tmm1 tmm1 merged commit 7a44d7c into eventmachine:master Feb 28, 2013

sodabrew pushed a commit to sodabrew/eventmachine that referenced this pull request Jan 27, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment