gimite / web-socket-js

HTML5 Web Socket implementation powered by Flash
BSD 3-Clause "New" or "Revised" License
2.73k stars 489 forks source link

IE9 does 0x00 byte truncation after message decoding with MessageEvent #133

Open Nyanna opened 11 years ago

Nyanna commented 11 years ago

not only Opera shows the 0x00 byte truncation bug. IE9 shows the same behavior so IE9 should also use the closure fix.

gimite commented 11 years ago

Thanks for the patch and sorry for late. I'll take a look soon.

Nyanna commented 11 years ago

no problem, its not urgent.

gimite commented 11 years ago

I tried sending "foo\0bar" to IE9 and it was handled correctly. Have you tried the same code with Chrome? If it happens in Chrome too, it's likely that your server has problem sending null bytes, not client.

Nyanna commented 11 years ago

Tobias and i had several tests, under chrome it did functioning. Maybe its related to a specific library IE9 is using, windows service packs, hotfixes, windows version etc. When the server should be the cause, why this get fixed with the pushed workaround? Clear to us is that the IE9 is likely to show the same behavior as already reported and we simply skiped the "copy to native api"-action. I would guess that has something todo wihtin a copy loop that breaks on standard C zero byte string termination.

Maybe on the next release we can send u the real usecase u can test on.

gimite commented 11 years ago

I found that IE9 doesn't define either document.createEvent nor window.MessageEvent. So usually it doesn't go to code path using document.createEvent in IE9 anyway. Maybe one of the libraries you are using defines document.createEvent and window.MessageEvent, and the implementation has a bug truncating after null byte?