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

Browser infinite loop issue #127

Closed
LivInTheLookingGlass opened this issue Jan 8, 2017 · 6 comments
Closed

Browser infinite loop issue #127

LivInTheLookingGlass opened this issue Jan 8, 2017 · 6 comments
Assignees
Milestone

Comments

@LivInTheLookingGlass
Copy link
Collaborator

To reproduce:

Construct a node in node.js like:

let js2p = require('./js_src/js2p.js');
let conn = new js2p.mesh.mesh_socket('localhost', 4444, new js2p.base.protocol('test', 'ws'));

Create and connect node in Firefox using:

let conn = new js2p.mesh.mesh_socket(null, null, new js2p.base.protocol('test', 'ws'));
conn.connect('localhost', 4444);

Watch everything break

@LivInTheLookingGlass
Copy link
Collaborator Author

This appears to be from the inclusion of zlibjs. I'm not sure why the compression is making things fail, though. All other issues are fixed thus far. I will try this again momentarily.

@LivInTheLookingGlass
Copy link
Collaborator Author

Still present. Still only occurs when zlibjs is included. Not sure what's going on, nor how to debug it, since Firefox dies every time I get a connection.

@LivInTheLookingGlass
Copy link
Collaborator Author

Thought: Does this also happen when talking from a websocket server to another? Or, for that matter, on chromium?

@LivInTheLookingGlass
Copy link
Collaborator Author

On chromium errors continuously pile up. It looks like it's trying to disconnect, but failing. It crashed chromium after building up ~15000 errors. The server node noticed nothing at all.

@LivInTheLookingGlass
Copy link
Collaborator Author

As a sidenote, browser error handling seems to be disabled, since it currently relies on the socket emit function. Things will get easier to fix once that is corrected.

@LivInTheLookingGlass
Copy link
Collaborator Author

LivInTheLookingGlass commented Jan 12, 2017

Okay, the error is caused by (depending on viewpoint):

  1. The server erroneously sending a compressed message
  2. The receiver erroneously deciding the message wasn't compressed.

When you manually set the compression methods to the real list, everything works again. So this issue has two necessary fixes:

  • Ensure browsers can disconnect properly
  • Ensure that the first sent message is never compressed

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

No branches or pull requests

1 participant