Navigation Menu

Skip to content

Commit

Permalink
Fixes for htmlfile, multipart, polling
Browse files Browse the repository at this point in the history
Removed patches
Removed server events
  • Loading branch information
rauchg committed Apr 30, 2010
1 parent c4cf1b2 commit a977ecd
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 238 deletions.
2 changes: 1 addition & 1 deletion lib/socket.io/listener.js
Expand Up @@ -11,7 +11,7 @@ Listener = this.Listener = Class({
options: {
origins: '*:*',
resource: 'socket.io',
transports: ['websocket', 'server-events', 'flashsocket', 'htmlfile', 'xhr-multipart', 'xhr-polling'],
transports: ['websocket', 'flashsocket', 'htmlfile', 'xhr-multipart', 'xhr-polling'],
timeout: 8000,
log: function(message){
sys.log(message);
Expand Down
20 changes: 8 additions & 12 deletions lib/socket.io/transports/htmlfile.js
Expand Up @@ -7,17 +7,10 @@ this['htmlfile'] = Client.extend({
switch (req.method){
case 'GET':
var self = this;
this.__super__(req, res);
this.request.addListener('end', function(){
if (!('hijack' in self.connection)){
throw new Error('You have to patch Node! Please refer to the README');
}

self.connection.addListener('end', function(){ self._onClose(); });
self.connection.hijack();
self.connection.setTimeout(0);
});

this.__super__(req, res);

this.response.useChunkedEncodingByDefault = false;
this.response.shouldKeepAlive = true;
this.response.writeHead(200, { 'Content-type': 'text/html' });
this.response.flush();

Expand All @@ -26,8 +19,11 @@ this['htmlfile'] = Client.extend({

case 'POST':
req.addListener('data', function(message){
body += message;
});
req.addListener('end', function(){
try {
var msg = qs.parse(message);
var msg = qs.parse(body);
self._onMessage(msg.data);
} catch(e){}
res.writeHead(200);
Expand Down
46 changes: 0 additions & 46 deletions lib/socket.io/transports/server-events.js

This file was deleted.

19 changes: 7 additions & 12 deletions lib/socket.io/transports/xhr-multipart.js
Expand Up @@ -4,22 +4,14 @@ var Client = require('../client').Client,
this['xhr-multipart'] = Client.extend({

_onConnect: function(req, res){
var self = this;
var self = this, body = '';
switch (req.method){
case 'GET':
var self = this;
this.__super__(req, res);
this.request.addListener('end', function(){
if (!('hijack' in self.connection)){
throw new Error('You have to patch Node! Please refer to the README');
}

self.connection.addListener('end', function(){ self._onClose(); });
self.connection.hijack();
self.connection.setTimeout(0);
});

this.response.use_chunked_encoding_by_default = false;
this.response.useChunkedEncodingByDefault = false;
this.response.shouldKeepAlive = true;
this.response.writeHead(200, {
'Content-Type': 'multipart/x-mixed-replace;boundary=socketio',
'Connection': 'keep-alive'
Expand All @@ -32,8 +24,11 @@ this['xhr-multipart'] = Client.extend({

case 'POST':
req.addListener('data', function(message){
body += message;
});
req.addListener('end', function(){
try {
var msg = qs.parse(message);
var msg = qs.parse(body);
self._onMessage(msg.data);
} catch(e){}
res.writeHead(200);
Expand Down
5 changes: 4 additions & 1 deletion lib/socket.io/transports/xhr-polling.js
Expand Up @@ -21,8 +21,11 @@ this['xhr-polling'] = Client.extend({

case 'POST':
req.addListener('data', function(message){
body += message;
});
req.addListener('end', function(){
try {
var msg = qs.parse(message);
var msg = qs.parse(body);
self._onMessage(msg.data);
} catch(e){}
res.writeHead(200);
Expand Down
83 changes: 0 additions & 83 deletions patch/0.1.32.patch

This file was deleted.

83 changes: 0 additions & 83 deletions patch/0.1.33.patch

This file was deleted.

0 comments on commit a977ecd

Please sign in to comment.