turnpike icon indicating copy to clipboard operation
turnpike copied to clipboard

Autobahn.js RequestID differs from turnpikes

Open marshauf opened this issue 9 years ago • 3 comments

I am running turnpike on: Architecture: armv7l Byte Order: Little Endian Which is 32Bit.

Autobahn.js RequestID differs from turnpikes.

I think the problem is: type ID uint

Autobahn.js chooses for example this ID: 2267980555616256 Which overflows with uint on an 32bit system.

At a quick glance I couldn't find any information on what bit size the ID is.

marshauf avatar Oct 01 '15 16:10 marshauf

Ah I found it:

IDs in the global scope MUST be drawn randomly from a uniform distribution over the complete range [0, 2^53]

Which means type ID uint needs to be uint64

marshauf avatar Oct 01 '15 16:10 marshauf

Good catch. I changed the maxID const to int64, but I forgot the ID type.

jcelliott avatar Oct 01 '15 16:10 jcelliott

I found another 10 cases where an uint is used for an ID. All in router.go. They are mostly related to callbacks. The program will most likely panic now due an overflow error on 32Bit system instead of handling it while decoding(?).

marshauf avatar Oct 01 '15 17:10 marshauf