Skip to content

Commit

Permalink
Release 1.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Feb 14, 2015
1 parent 3c00f97 commit 3309c15
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 33 deletions.
5 changes: 5 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

1.3.4 / 2015-02-14
==================

* build `socket.io.js` with `engine.io-client` `1.5.1`

1.3.3 / 2015-02-03
==================

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "socket.io-client",
"version": "1.3.3",
"version": "1.3.4",
"keywords": [
"realtime",
"framework",
Expand All @@ -23,7 +23,7 @@
"backo2": "1.0.2"
},
"devDependencies": {
"socket.io": "1.3.3",
"socket.io": "1.3.4",
"mocha": "1.16.2",
"zuul": "rase-/zuul#9d3a02",
"istanbul": "0.2.1",
Expand Down
41 changes: 10 additions & 31 deletions socket.io.js
Original file line number Diff line number Diff line change
Expand Up @@ -1612,7 +1612,6 @@ function Socket(uri, opts){
this.rememberUpgrade = opts.rememberUpgrade || false;
this.binaryType = null;
this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades;
this.perMessageDeflate = false !== opts.perMessageDeflate ? (opts.perMessageDeflate || true) : false;

// SSL options for Node.js client
this.pfx = opts.pfx || null;
Expand Down Expand Up @@ -1694,8 +1693,7 @@ Socket.prototype.createTransport = function (name) {
cert: this.cert,
ca: this.ca,
ciphers: this.ciphers,
rejectUnauthorized: this.rejectUnauthorized,
perMessageDeflate: this.perMessageDeflate
rejectUnauthorized: this.rejectUnauthorized
});

return transport;
Expand Down Expand Up @@ -1803,7 +1801,7 @@ Socket.prototype.probe = function (name) {
if (failed) return;

debug('probe transport "%s" opened', name);
transport.send([{ type: 'ping', data: 'probe', options: { compress: true } }]);
transport.send([{ type: 'ping', data: 'probe' }]);
transport.once('packet', function (msg) {
if (failed) return;
if ('pong' == msg.type && 'probe' == msg.data) {
Expand All @@ -1822,7 +1820,7 @@ Socket.prototype.probe = function (name) {
cleanup();

self.setTransport(transport);
transport.send([{ type: 'upgrade', options: { compress: true } }]);
transport.send([{ type: 'upgrade' }]);
self.emit('upgrade', transport);
transport = null;
self.upgrading = false;
Expand Down Expand Up @@ -2078,14 +2076,13 @@ Socket.prototype.flush = function () {
*
* @param {String} message.
* @param {Function} callback function.
* @param {Object} options.
* @return {Socket} for chaining.
* @api public
*/

Socket.prototype.write =
Socket.prototype.send = function (msg, options, fn) {
this.sendPacket('message', msg, options, fn);
Socket.prototype.send = function (msg, fn) {
this.sendPacket('message', msg, fn);
return this;
};

Expand All @@ -2094,29 +2091,16 @@ Socket.prototype.send = function (msg, options, fn) {
*
* @param {String} packet type.
* @param {String} data.
* @param {Object} options.
* @param {Function} callback function.
* @api private
*/

Socket.prototype.sendPacket = function (type, data, options, fn) {
if ('function' == typeof options) {
fn = options;
options = null;
}

Socket.prototype.sendPacket = function (type, data, fn) {
if ('closing' == this.readyState || 'closed' == this.readyState) {
return;
}

options = options || {};
options.compress = false !== options.compress;

var packet = {
type: type,
data: data,
options: options
};
var packet = { type: type, data: data };
this.emit('packetCreate', packet);
this.writeBuffer.push(packet);
this.callbackBuffer.push(fn);
Expand Down Expand Up @@ -3371,7 +3355,6 @@ function WS(opts){
if (forceBase64) {
this.supportsBinary = false;
}
this.perMessageDeflate = opts.perMessageDeflate;
Transport.call(this, opts);
}

Expand Down Expand Up @@ -3410,10 +3393,7 @@ WS.prototype.doOpen = function(){
var self = this;
var uri = this.uri();
var protocols = void(0);
var opts = {
agent: this.agent,
perMessageDeflate: this.perMessageDeflate
};
var opts = { agent: this.agent };

// SSL options for Node.js client
opts.pfx = this.pfx;
Expand Down Expand Up @@ -3487,13 +3467,12 @@ WS.prototype.write = function(packets){
// encodePacket efficient as it uses WS framing
// no need for encodePayload
for (var i = 0, l = packets.length; i < l; i++) {
var packet = packets[i];
parser.encodePacket(packet, this.supportsBinary, function(data) {
parser.encodePacket(packets[i], this.supportsBinary, function(data) {
//Sometimes the websocket has already been closed but the browser didn't
//have a chance of informing us about it yet, in that case send will
//throw an error
try {
self.ws.send(data, packet.options);
self.ws.send(data);
} catch (e){
debug('websocket closed before onclose event');
}
Expand Down

0 comments on commit 3309c15

Please sign in to comment.