socket.io-rails 1.0.1 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/socket.io-rails/version.rb +1 -1
- data/vendor/assets/javascripts/socket.io.js +20 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe39cef77a14096970e6c264320fe5b475ca4b11
|
4
|
+
data.tar.gz: 4da22ce362e7b65ef904f2aabddd1acd3dba5e8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1038d77c97e3766feda511081e7f8718c75ef7a401c9fe3efd3b85c9361de187712a135b0e8e2fbd57abcc4b1ff4fc372fa9479ab31da590358b3b68045f24ac
|
7
|
+
data.tar.gz: 5897bef70a90254ba85704da0987f1476f4253eaed18965f8c1de446d8816563caa3694ac1d30cf510ea6ff20abbbd989604f4ea95aebb5ffbf7768422d61230
|
@@ -772,6 +772,10 @@ Socket.prototype.onpacket = function(packet){
|
|
772
772
|
this.onack(packet);
|
773
773
|
break;
|
774
774
|
|
775
|
+
case parser.BINARY_ACK:
|
776
|
+
this.onack(packet);
|
777
|
+
break;
|
778
|
+
|
775
779
|
case parser.DISCONNECT:
|
776
780
|
this.ondisconnect();
|
777
781
|
break;
|
@@ -820,8 +824,10 @@ Socket.prototype.ack = function(id){
|
|
820
824
|
sent = true;
|
821
825
|
var args = toArray(arguments);
|
822
826
|
debug('sending ack %j', args);
|
827
|
+
|
828
|
+
var type = hasBin(args) ? parser.BINARY_ACK : parser.ACK;
|
823
829
|
self.packet({
|
824
|
-
type:
|
830
|
+
type: type,
|
825
831
|
id: id,
|
826
832
|
data: args
|
827
833
|
});
|
@@ -4738,6 +4744,7 @@ exports.types = [
|
|
4738
4744
|
'EVENT',
|
4739
4745
|
'BINARY_EVENT',
|
4740
4746
|
'ACK',
|
4747
|
+
'BINARY_ACK',
|
4741
4748
|
'ERROR'
|
4742
4749
|
];
|
4743
4750
|
|
@@ -4789,6 +4796,14 @@ exports.ERROR = 4;
|
|
4789
4796
|
|
4790
4797
|
exports.BINARY_EVENT = 5;
|
4791
4798
|
|
4799
|
+
/**
|
4800
|
+
* Packet type `binary ack`. For acks with binary arguments.
|
4801
|
+
*
|
4802
|
+
* @api public
|
4803
|
+
*/
|
4804
|
+
|
4805
|
+
exports.BINARY_ACK = 6;
|
4806
|
+
|
4792
4807
|
exports.Encoder = Encoder
|
4793
4808
|
|
4794
4809
|
/**
|
@@ -4811,7 +4826,7 @@ function Encoder() {};
|
|
4811
4826
|
Encoder.prototype.encode = function(obj, callback){
|
4812
4827
|
debug('encoding packet %j', obj);
|
4813
4828
|
|
4814
|
-
if (exports.BINARY_EVENT == obj.type || exports.
|
4829
|
+
if (exports.BINARY_EVENT == obj.type || exports.BINARY_ACK == obj.type) {
|
4815
4830
|
encodeAsBinary(obj, callback);
|
4816
4831
|
}
|
4817
4832
|
else {
|
@@ -4836,7 +4851,7 @@ function encodeAsString(obj) {
|
|
4836
4851
|
str += obj.type;
|
4837
4852
|
|
4838
4853
|
// attachments if we have them
|
4839
|
-
if (exports.BINARY_EVENT == obj.type || exports.
|
4854
|
+
if (exports.BINARY_EVENT == obj.type || exports.BINARY_ACK == obj.type) {
|
4840
4855
|
str += obj.attachments;
|
4841
4856
|
str += '-';
|
4842
4857
|
}
|
@@ -4922,7 +4937,7 @@ Decoder.prototype.add = function(obj) {
|
|
4922
4937
|
var packet;
|
4923
4938
|
if ('string' == typeof obj) {
|
4924
4939
|
packet = decodeString(obj);
|
4925
|
-
if (exports.BINARY_EVENT == packet.type || exports.
|
4940
|
+
if (exports.BINARY_EVENT == packet.type || exports.BINARY_ACK == packet.type) { // binary packet's json
|
4926
4941
|
this.reconstructor = new BinaryReconstructor(packet);
|
4927
4942
|
|
4928
4943
|
// no attachments, labeled binary but no binary data to follow
|
@@ -4968,7 +4983,7 @@ function decodeString(str) {
|
|
4968
4983
|
if (null == exports.types[p.type]) return error();
|
4969
4984
|
|
4970
4985
|
// look up attachments if type binary
|
4971
|
-
if (exports.BINARY_EVENT == p.type || exports.
|
4986
|
+
if (exports.BINARY_EVENT == p.type || exports.BINARY_ACK == p.type) {
|
4972
4987
|
p.attachments = '';
|
4973
4988
|
while (str.charAt(++i) != '-') {
|
4974
4989
|
p.attachments += str.charAt(i);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: socket.io-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Chen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|