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

Fix incorrect message size; Use nio for decoding. #598

Merged
merged 1 commit into from
Sep 6, 2012

Conversation

nite23
Copy link
Contributor

@nite23 nite23 commented Sep 6, 2012

No description provided.

@jfarcand jfarcand merged commit 4f1160c into Atmosphere:master Sep 6, 2012
@jfarcand
Copy link
Member

jfarcand commented Sep 6, 2012

Thanks!

@Gekkio
Copy link
Contributor

Gekkio commented Sep 6, 2012

Sorry for intruding, but one thing caught my attention in this pull request:

What is the lifecycle of Interceptors? Are they created once and reused by multiple threads? If so, that code will break because CharsetDecoder/CharsetEncoder are not thread-safe. The class stores them in instance variables and reuses them in each call to transform().

@jfarcand
Copy link
Member

jfarcand commented Sep 6, 2012

@Gekkio Good catch! We need to fix that problem for sure.

@nite23
Copy link
Contributor Author

nite23 commented Sep 6, 2012

@Gekkio Thanks for noticing. Here's a fix: ab841a6
I guess this would be better than synchronizing on the encoder/decoder...

@Gekkio
Copy link
Contributor

Gekkio commented Sep 6, 2012

Yeah, that fix works fine. It does create a bit more temporary objects than before, but that's the right way to do it since synchronizing would kill the performance.

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.

3 participants