Commit Graph

17 Commits

Author SHA1 Message Date
Damien Arrachequesne
b47efb270d [fix] Remove any reference to the global variable
Related: https://github.com/socketio/socket.io-client/issues/1166
2018-11-07 23:31:49 +01:00
Damien Arrachequesne
b4f849a6fe [fix] Fix Blob detection for iOS 8/9 (#69) 2017-04-26 21:43:22 +02:00
Damien Arrachequesne
2f31a4e8f7 [fix] Ensure globals are functions before running instanceof (#68)
Following https://github.com/socketio/has-binary/pull/4.
2017-04-25 00:21:17 +02:00
Gatsbill
2314c10f4f [perf] Small optimisations (#57) 2016-12-30 22:25:49 +01:00
Gatsbill
9072faa1e1 [refactor] Remove unused var (#53) 2016-12-17 02:33:05 +01:00
Gatsbill
97721957b9 [refactor] Use strict equality when possible (#52) 2016-12-17 02:32:21 +01:00
Damien Arrachequesne
0e2dcb7281 [chore] Revert "Remove deprecated isarray dependency" (#50)
The fallback is needed for IE6, IE7 and IE8.
2016-10-24 02:29:22 +02:00
Damien Arrachequesne
e8f7c32a43 [chore] Remove deprecated isarray dependency (#46)
Closes #38
2016-10-21 01:03:33 +02:00
Guillermo Rauch
0ae9a4fba6 prevent direct Buffer reference that breaks browserify 2014-09-04 10:14:23 +02:00
Guillermo Rauch
3cef88bc88 binary: reuse isBuf helper 2014-08-10 10:43:45 -07:00
Guillermo Rauch
0c755f93e4 clean up syntax 2014-08-10 10:43:00 -07:00
Kevin Roark
4e33d6a6c5 Less indentation and a small optimization
The optimization is the "else if" instead of "if" for checking
array in _removeBlobs. No need to iterate over keys of a blob.
2014-05-31 22:41:12 -07:00
Tony Kovanen
e2fb6e58c8 don't iterate keys of date objects 2014-05-24 19:33:30 +03:00
Kevin Roark
6d3218eb3a fix null reconstruction bug 2014-05-15 10:51:39 -04:00
Kevin Roark
ba64f07bca Removed has-binary-data dependency
And replaced it with better isBuf function. Has binary data would not have
checked objects that contain blobs. isBuf only checks the current object,
not its child objects
2014-03-05 00:20:52 -05:00
Kevin Roark
47df0694f5 Fixed the object check in binary.removeBlobs
Remove blobs has to iterate over a javascript object and asynchronously
remove the blobs / files. It does this by iterating over arrays and
objects in the larger object recursively.

Problem was in checking for object to iterate over, wasn't checking if
that object was binary data itself. So it was working, but really slowly,
by iterating over every byte in a Buffer and checking it for blobs.
Much faster now :)
2014-03-04 23:50:36 -05:00
Kevin Roark
299849b002 A faster and smaller binary parser and protocol
This is a squash of a few commits. Below is a small summary of commits.

Results from it: before the build size of socket.io-client was ~250K.
Now it is ~215K.
Tests I was doing here
(https://github.com/kevin-roark/socketio-binaryexample/tree/speed-testing)
take about 1/4 - 1/5 as long with this commit compared to msgpack.

The first was the initial rewrite of the encoding, which removes msgpack
and instead uses a sequence of engine.write's for a binary event. The
first write is the packet metadata with placeholders in the json for
any binary data. Then the following events are the raw binary data that
get filled by the placeholders.

The second commit was bug fixes that made the tests pass.

The third commit was removing unnecssary packages from package.json.

Fourth commit was adding nice comments, and 5th commit was merging
upstream.

The remaining commits involved merging with actual socket.io-parser,
rather than the protocol repository. Oops.
2014-02-26 22:31:39 -05:00