Compare commits

...

5 Commits
0.7.1 ... 0.7.2

Author SHA1 Message Date
Guillermo Rauch
331e6e85b9 Release 0.7.2 2011-06-22 04:15:01 -03:00
Guillermo Rauch
f2df40aa02 Bumped client version.
Bumped version
2011-06-22 04:12:26 -03:00
Guillermo Rauch
36ecd49ad2 Updated tests. 2011-06-22 04:09:19 -03:00
Guillermo Rauch
aef5027640 Make sure to write a packet (of type noop) when closing a poll. This solves a problem
with cross-domain requests being flagged as aborted and reconnection being triggered.
2011-06-22 04:08:28 -03:00
Guillermo Rauch
4933cf1a9e Added noop message type. 2011-06-22 04:08:11 -03:00
7 changed files with 89 additions and 59 deletions

View File

@@ -1,4 +1,12 @@
0.7.2 / 2011-06-22
==================
* Make sure to write a packet (of type `noop`) when closing a poll.
This solves a problem with cross-domain requests being flagged as aborted and
reconnection being triggered.
* Added `noop` message type.
0.7.1 / 2011-06-21
==================

View File

@@ -22,6 +22,7 @@ var packets = exports.packets = [
, 'event'
, 'ack'
, 'error'
, 'noop'
];
/**

View File

@@ -17,7 +17,7 @@ var http = require('http')
* Version.
*/
exports.version = '0.7.0';
exports.version = '0.7.2';
/**
* Supported protocol version.

View File

@@ -56,7 +56,7 @@ HTTPPolling.prototype.handleRequest = function (req) {
var self = this;
this.pollTimeout = setTimeout(function () {
self.close();
self.packet({ type: 'noop' });
self.log.debug('polling closed due to exceeded duration');
}, this.manager.get('polling duration') * 1000);

View File

@@ -1,6 +1,6 @@
{
"name": "socket.io"
, "version": "0.7.1"
, "version": "0.7.2"
, "description": "Realtime apps made cross-browser & easy with a WebSocket-like API"
, "homepage": "http://socket.io"
, "keywords": ["websocket", "socket", "realtime", "socket.io", "comet", "ajax"]
@@ -15,7 +15,7 @@
, "url": "https://github.com/LearnBoost/Socket.IO-node.git"
}
, "dependencies": {
"socket.io-client": "0.7.0"
"socket.io-client": "0.7.2"
, "policyfile": ">= 0.0.3"
}
, "devDependencies": {

View File

@@ -178,9 +178,10 @@ module.exports = {
});
// we rely on a small poll duration to close this request quickly
cl.get('/socket.io/{protocol}/jsonp-polling/' + sid, function (res, data) {
cl.get('/socket.io/{protocol}/jsonp-polling/' + sid, function (res, msgs) {
res.statusCode.should.eql(200);
data.should.eql('');
msgs.should.have.length(1);
msgs[0].should.eql({ type: 'noop', endpoint: '' });
--total || finish();
});
});
@@ -459,8 +460,9 @@ module.exports = {
});
cl.handshake(function (sid) {
cl.get('/socket.io/{protocol}/jsonp-polling/' + sid, function (res, data) {
data.should.eql('');
cl.get('/socket.io/{protocol}/jsonp-polling/' + sid, function (res, msgs) {
msgs.should.have.length(1);
msgs[0].should.eql({ type: 'noop', endpoint: '' });
tobi();
@@ -649,9 +651,10 @@ module.exports = {
});
cl.handshake(function (sid) {
cl.get('/socket.io/{protocol}/jsonp-polling/' + sid, function (res, data) {
cl.get('/socket.io/{protocol}/jsonp-polling/' + sid, function (res, msgs) {
res.statusCode.should.eql(200);
data.should.eql('');
msgs.should.have.length(1);
msgs[0].should.eql({ type: 'noop', endpoint: '' });
cl.post(
'/socket.io/{protocol}/jsonp-polling/' + sid

View File

@@ -114,9 +114,10 @@ module.exports = {
});
// we rely on a small poll duration to close this request quickly
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, data) {
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, msgs) {
res.statusCode.should.eql(200);
data.should.eql('');
msgs.should.have.length(1);
msgs[0].should.eql({ type: 'noop', endpoint: '' });
--total || finish();
});
});
@@ -395,8 +396,10 @@ module.exports = {
});
cl.handshake(function (sid) {
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, data) {
data.should.eql('');
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, msgs) {
res.statusCode.should.equal(200);
msgs.should.have.length(1);
msgs[0].should.eql({ type: 'noop', endpoint: '' });
tobi();
@@ -585,9 +588,10 @@ module.exports = {
});
cl.handshake(function (sid) {
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, data) {
res.statusCode.should.eql(200);
data.should.eql('');
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, msgs) {
res.statusCode.should.equal(200);
msgs.should.have.length(1);
msgs[0].should.eql({ type: 'noop', endpoint: '' });
cl.post(
'/socket.io/{protocol}/xhr-polling/' + sid
@@ -724,9 +728,10 @@ module.exports = {
});
cl.handshake(function (sid) {
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, data) {
res.statusCode.should.eql(200);
data.should.eql('');
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, msgs) {
res.statusCode.should.equal(200);
msgs.should.have.length(1);
msgs[0].should.eql({ type: 'noop', endpoint: '' });
s.json.send(['a', 'b', 'c']);
s.json.send({
@@ -785,9 +790,10 @@ module.exports = {
});
cl.handshake(function (sid) {
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, data) {
res.statusCode.should.eql(200);
data.should.eql('');
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, msgs) {
res.statusCode.should.equal(200);
msgs.should.have.length(1);
msgs[0].should.eql({ type: 'noop', endpoint: '' });
cl.post(
'/socket.io/{protocol}/xhr-polling/' + sid
@@ -837,9 +843,10 @@ module.exports = {
});
cl.handshake(function (sid) {
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, data) {
res.statusCode.should.eql(200);
data.should.eql('');
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, msgs) {
res.statusCode.should.equal(200);
msgs.should.have.length(1);
msgs[0].should.eql({ type: 'noop', endpoint: '' });
s.emit('tobi is playing');
@@ -879,9 +886,10 @@ module.exports = {
});
cl.handshake(function (sid) {
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, data) {
res.statusCode.should.eql(200);
data.should.eql('');
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, msgs) {
res.statusCode.should.equal(200);
msgs.should.have.length(1);
msgs[0].should.eql({ type: 'noop', endpoint: '' });
s.emit('edwald', { woot: 'woot' }, [1, 2, 3]);
@@ -924,9 +932,10 @@ module.exports = {
});
cl.handshake(function (sid) {
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, data) {
res.statusCode.should.eql(200);
data.should.eql('');
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, msgs) {
res.statusCode.should.equal(200);
msgs.should.have.length(1);
msgs[0].should.eql({ type: 'noop', endpoint: '' });
cl.post(
'/socket.io/{protocol}/xhr-polling/' + sid
@@ -971,9 +980,10 @@ module.exports = {
});
cl.handshake(function (sid) {
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, data) {
res.statusCode.should.eql(200);
data.should.eql('');
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, msgs) {
res.statusCode.should.equal(200);
msgs.should.have.length(1);
msgs[0].should.eql({ type: 'noop', endpoint: '' });
cl.post(
'/socket.io/{protocol}/xhr-polling/' + sid
@@ -1012,15 +1022,17 @@ module.exports = {
});
cl.handshake(function (sid) {
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, data) {
res.statusCode.should.eql(200);
data.should.eql('');
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, msgs) {
res.statusCode.should.equal(200);
msgs.should.have.length(1);
msgs[0].should.eql({ type: 'noop', endpoint: '' });
s.volatile.send('woooot');
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, data) {
res.statusCode.should.eql(200);
data.should.eql('');
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, msgs) {
res.statusCode.should.equal(200);
msgs.should.have.length(1);
msgs[0].should.eql({ type: 'noop', endpoint: '' });
});
});
});
@@ -1047,15 +1059,17 @@ module.exports = {
});
cl.handshake(function (sid) {
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, data) {
res.statusCode.should.eql(200);
data.should.eql('');
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, msgs) {
res.statusCode.should.equal(200);
msgs.should.have.length(1);
msgs[0].should.eql({ type: 'noop', endpoint: '' });
s.volatile.json.send('woooot');
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, data) {
res.statusCode.should.eql(200);
data.should.eql('');
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, msgs) {
res.statusCode.should.equal(200);
msgs.should.have.length(1);
msgs[0].should.eql({ type: 'noop', endpoint: '' });
});
});
});
@@ -1082,15 +1096,17 @@ module.exports = {
});
cl.handshake(function (sid) {
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, data) {
res.statusCode.should.eql(200);
data.should.eql('');
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, msgs) {
res.statusCode.should.equal(200);
msgs.should.have.length(1);
msgs[0].should.eql({ type: 'noop', endpoint: '' });
s.volatile.emit('woooot');
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, data) {
res.statusCode.should.eql(200);
data.should.eql('');
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, msgs) {
res.statusCode.should.equal(200);
msgs.should.have.length(1);
msgs[0].should.eql({ type: 'noop', endpoint: '' });
});
});
});
@@ -1236,9 +1252,10 @@ module.exports = {
});
cl.handshake(function (sid) {
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, data) {
res.statusCode.should.eql(200);
data.should.eql('');
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, msgs) {
res.statusCode.should.equal(200);
msgs.should.have.length(1);
msgs[0].should.eql({ type: 'noop', endpoint: '' });
cl.post(
'/socket.io/{protocol}/xhr-polling/' + sid
@@ -2509,9 +2526,10 @@ module.exports = {
});
cl.handshake(function (sid) {
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, data) {
res.statusCode.should.eql(200);
data.should.eql('');
cl.get('/socket.io/{protocol}/xhr-polling/' + sid, function (res, msgs) {
res.statusCode.should.equal(200);
msgs.should.have.length(1);
msgs[0].should.eql({ type: 'noop', endpoint: '' });
cl.post(
'/socket.io/{protocol}/xhr-polling/' + sid