Skip to content
Browse files

Multipart fix for Node 0.1.98

  • Loading branch information...
1 parent 06769c4 commit d79de5aa56eb2fa89850c71c8d966e8f54b89591 @rauchg rauchg committed Jun 18, 2010
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/socket.io/transports/xhr-multipart.js
View
6 lib/socket.io/transports/xhr-multipart.js
@@ -1,5 +1,5 @@
var Client = require('../client').Client,
- qs = require('querystring');
+ qs = require('querystring');
exports['xhr-multipart'] = Client.extend({
@@ -34,7 +34,7 @@ exports['xhr-multipart'] = Client.extend({
this.response.shouldKeepAlive = true;
this.response.writeHead(200, headers);
this.response.write("--socketio\n");
- this.response.flush();
+ if ('flush' in this.response) this.response.flush();
this._payload();
this._heartbeatInterval = setInterval(function(){
self._write(String.fromCharCode(6));
@@ -63,7 +63,7 @@ exports['xhr-multipart'] = Client.extend({
this.response.write("Content-Type: text/plain" + (message.length === 1 && message.charCodeAt(0) === 6 ? "; charset=us-ascii" : "") + "\n\n");
this.response.write(message + "\n");
this.response.write("--socketio\n");
- this.response.flush();
+ if ('flush' in this.response) this.response.flush();
}
});

0 comments on commit d79de5a

Please sign in to comment.
Something went wrong with that request. Please try again.