From d79de5aa56eb2fa89850c71c8d966e8f54b89591 Mon Sep 17 00:00:00 2001 From: Guillermo Rauch Date: Fri, 18 Jun 2010 02:38:08 -0300 Subject: [PATCH] Multipart fix for Node 0.1.98 --- lib/socket.io/transports/xhr-multipart.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/socket.io/transports/xhr-multipart.js b/lib/socket.io/transports/xhr-multipart.js index 0acf372f6a..54f9524620 100644 --- a/lib/socket.io/transports/xhr-multipart.js +++ b/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(); } }); \ No newline at end of file