Compare commits

...

5 Commits

Author SHA1 Message Date
Guillermo Rauch
29974ac777 Release 1.3.3 2015-02-03 17:27:51 -08:00
Guillermo Rauch
ef23c74bea remove compression tests 2015-02-03 17:07:43 -08:00
Guillermo Rauch
49423d70bc added failing tests 2015-02-03 17:04:33 -08:00
Guillermo Rauch
715c7f99b4 socket: warn node_redis-style about missing error 2015-02-03 17:04:06 -08:00
Guillermo Rauch
f2ea965c6b package: bump parser 2015-02-03 16:32:48 -08:00
4 changed files with 49 additions and 4 deletions

View File

@@ -1,4 +1,10 @@
1.3.3 / 2015-02-03
==================
* socket: warn node_redis-style about missing `error`
* package: bump parser to better handle bad binary packets
1.3.2 / 2015-01-19
==================

View File

@@ -390,7 +390,12 @@ Socket.prototype.ondisconnect = function(){
*/
Socket.prototype.onerror = function(err){
this.emit('error', err);
if (this.listeners('error').length) {
this.emit('error', err);
} else {
console.error('Missing error handler on `socket`.');
console.error(err.stack);
}
};
/**

View File

@@ -1,6 +1,6 @@
{
"name": "socket.io",
"version": "1.3.2",
"version": "1.3.3",
"description": "node.js realtime framework server",
"keywords": [
"realtime",
@@ -20,8 +20,8 @@
},
"dependencies": {
"engine.io": "1.5.1",
"socket.io-parser": "2.2.2",
"socket.io-client": "1.3.2",
"socket.io-parser": "2.2.3",
"socket.io-client": "1.3.3",
"socket.io-adapter": "0.3.1",
"has-binary-data": "0.1.3",
"debug": "2.1.0"

View File

@@ -1329,6 +1329,40 @@ describe('socket.io', function(){
});
});
});
it('should error with raw binary and warn', function(done){
var srv = http();
var sio = io(srv);
srv.listen(function(){
var socket = client(srv);
sio.on('connection', function(s){
s.conn.on('upgrade', function(){
console.log('\033[96mNote: warning expected and normal in test.\033[39m');
socket.io.engine.write('5woooot');
setTimeout(function(){
done();
}, 100);
});
});
});
});
it('should not crash with raw binary', function(done){
var srv = http();
var sio = io(srv);
srv.listen(function(){
var socket = client(srv);
sio.on('connection', function(s){
s.once('error', function(err){
expect(err.message).to.match(/Illegal attachments/);
done();
});
s.conn.on('upgrade', function(){
socket.io.engine.write('5woooot');
});
});
});
});
});
describe('messaging many', function(){