Comments (2)
This is even weirder than I thought: sometimes we fails to connect between the client & the server. After EXTENSIVE digging, I figured out that this is happening due to our abuse of the namespace protocol of socket.io. The namespace criteria itself is undocumented; I deduced that it couldn't have certain special characters like ',' in them, and constructed a namespace that I thought looked reasonable (e.g. '/module0X0X1920X1080X0', which is '/module' + rect + module deadline). In order to avoid a second round-trip, we actually connect to a namespace with additional data tacked on like a URL (e.g. /module0X0X1920X1080X0?id=0,0,1920,1080-0&rect=0,0,1920,1080), which seemed to work just fine in my testing. However, the actual code that parses a response on the server from the client looks like this:
p.nsp = '';
while (++i) {
var c = str.charAt(i);
if (',' == c) break;
p.nsp += c;
if (i == str.length) break;
}
and then attempt to json decode the rest of the string-form of the packet. At first glance, this should never work, but it turns out for certain values of deadline, this parses perfectly, allowing the client & server modules to communicate. I've been poking around with changing the meaning of things like 'deadline' and when doing so, this bug appeared, which causes the CONNECT packet to be unparseable and dropped, leading to the module halves being unable to communicate with each other.
The fix is to not abuse the namespace in this way, and require a second round-trip to transfer id and rect, OR, allow the namespace to be parsed back to id and rect. The former introduces a new 'pending' state for client connections, which sounds hard, so I'll be preferring the latter approach.
from chicago-brick.
Done in #273.
from chicago-brick.
Related Issues (20)
- Use es6-standard module support HOT 6
- Add dev/prod mode split to server
- Add 'type' to monitor API
- Let slideshow local mode pass in multiple files HOT 1
- Wind: Show forecast time on the title card.
- Wind: Move projection and visualization parameters to module config.
- Remove concept of 'partition' from code
- guarantee that tick() is never called with an undefined time
- Mismatching licenses between LICENSE and package.json
- Add presplit mode to load_drive
- Change wall_geometry to just be a rectangle and a concave hull
- Implement reasonable "concave-hull" algorithm in JS (or borrow one).
- Clients display black screen in anything more than single client mode HOT 3
- Replace google-drive-sheets with official google sheets package
- Investigate recent brokenness around googleapis
- Tolerate spaces in names of modules
- Move express module registration to happen dynamically
- Provide API to handle async tasks in modules
- Wall crashes when drive file is missing.
- Guard authenticate_google_api's calls to OAuth
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chicago-brick.