ericz 11 years ago
parent
commit
8f33da104c
2 changed files with 2 additions and 4 deletions
  1. 2 4
      dist/peer.js
  2. 0 0
      dist/peer.min.js

+ 2 - 4
dist/peer.js

@@ -1752,7 +1752,6 @@ function DataConnection(peer, provider, options) {
   if (!(this instanceof DataConnection)) return new DataConnection(peer, provider, options);
   if (!(this instanceof DataConnection)) return new DataConnection(peer, provider, options);
   EventEmitter.call(this);
   EventEmitter.call(this);
 
 
-  // TODO: perhaps default serialization should be binary-utf8?
   this.options = util.extend({
   this.options = util.extend({
     serialization: 'binary',
     serialization: 'binary',
     reliable: false
     reliable: false
@@ -1906,9 +1905,8 @@ DataConnection.prototype.send = function(data, chunked) {
   var self = this;
   var self = this;
   if (this.serialization === 'json') {
   if (this.serialization === 'json') {
     this._bufferedSend(JSON.stringify(data));
     this._bufferedSend(JSON.stringify(data));
-  } else if ('binary-utf8'.indexOf(this.serialization) !== -1) {
-    var utf8 = (this.serialization === 'binary-utf8');
-    var blob = util.pack(data, utf8);
+  } else if (this.serialization === 'binary' || this.serialization === 'binary-utf8') {
+    var blob = util.pack(data);
 
 
     if (util.browser !== 'Firefox' && !chunked && blob.size > util.chunkedMTU) {
     if (util.browser !== 'Firefox' && !chunked && blob.size > util.chunkedMTU) {
       this._sendChunks(blob);
       this._sendChunks(blob);

File diff suppressed because it is too large
+ 0 - 0
dist/peer.min.js


Some files were not shown because too many files changed in this diff