Skip to content
Browse files

Fix issue #90

* pass request to ResponseReceiver
* use req.connection instead of res.connection
  • Loading branch information...
1 parent 063bac4 commit 6ea81910465d48d2886966f1b169344010a197ad @pl pl committed with majek Oct 22, 2012
Showing with 10 additions and 10 deletions.
  1. +1 −1 src/trans-eventsource.coffee
  2. +1 −1 src/trans-htmlfile.coffee
  3. +3 −3 src/trans-jsonp.coffee
  4. +2 −2 src/trans-xhr.coffee
  5. +3 −3 src/transport.coffee
View
2 src/trans-eventsource.coffee
@@ -25,5 +25,5 @@ exports.app =
# Opera needs one more new line at the start.
res.write('\r\n')
- transport.register(req, @, new EventSourceReceiver(res, @options))
+ transport.register(req, @, new EventSourceReceiver(req, res, @options))
return true
View
2 src/trans-htmlfile.coffee
@@ -56,5 +56,5 @@ exports.app =
res.writeHead(200)
res.write(iframe_template.replace(/{{ callback }}/g, callback));
- transport.register(req, @, new HtmlFileReceiver(res, @options))
+ transport.register(req, @, new HtmlFileReceiver(req, res, @options))
return true
View
6 src/trans-jsonp.coffee
@@ -10,8 +10,8 @@ class JsonpReceiver extends transport.ResponseReceiver
protocol: "jsonp-polling"
max_response_size: 1
- constructor: (res, options, @callback) ->
- super(res, options)
+ constructor: (req, res, options, @callback) ->
+ super(req, res, options)
doSendFrame: (payload) ->
# Yes, JSONed twice, there isn't a a better way, we must pass
@@ -38,7 +38,7 @@ exports.app =
res.setHeader('Content-Type', 'application/javascript; charset=UTF-8')
res.writeHead(200)
- transport.register(req, @, new JsonpReceiver(res, @options, callback))
+ transport.register(req, @, new JsonpReceiver(req, res, @options, callback))
return true
jsonp_send: (req, res, query) ->
View
4 src/trans-xhr.coffee
@@ -72,7 +72,7 @@ exports.app =
res.setHeader('Content-Type', 'application/javascript; charset=UTF-8')
res.writeHead(200)
- transport.register(req, @, new XhrPollingReceiver(res, @options))
+ transport.register(req, @, new XhrPollingReceiver(req, res, @options))
return true
xhr_streaming: (req, res, _, next_filter) ->
@@ -83,5 +83,5 @@ exports.app =
# http://blogs.msdn.com/b/ieinternals/archive/2010/04/06/comet-streaming-in-internet-explorer-with-xmlhttprequest-and-xdomainrequest.aspx
res.write(Array(2049).join('h') + '\n')
- transport.register(req, @, new XhrStreamingReceiver(res, @options) )
+ transport.register(req, @, new XhrStreamingReceiver(req, res, @options) )
return true
View
6 src/transport.coffee
@@ -258,12 +258,12 @@ class GenericReceiver
class ResponseReceiver extends GenericReceiver
max_response_size: undefined
- constructor: (@response, @options) ->
+ constructor: (@request, @response, @options) ->
@curr_response_size = 0
try
- @response.connection.setKeepAlive(true, 5000)
+ @request.connection.setKeepAlive(true, 5000)
catch x
- super (@response.connection)
+ super (@request.connection)
if @max_response_size is undefined
@max_response_size = @options.response_limit

0 comments on commit 6ea8191

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