Permalink
Browse files

Merge branch 'master' into dev

  • Loading branch information...
2 parents f83f99f + 519e960 commit e6a3ab4d7a0ae8f9e2fd7b5a0afd2d3f736c4125 @majek majek committed Nov 15, 2012
Showing with 32 additions and 16 deletions.
  1. +15 −0 Changelog
  2. +6 −2 README.md
  3. +1 −4 package.json
  4. +1 −1 src/trans-eventsource.coffee
  5. +1 −1 src/trans-htmlfile.coffee
  6. +3 −3 src/trans-jsonp.coffee
  7. +2 −2 src/trans-xhr.coffee
  8. +3 −3 src/transport.coffee
View
@@ -1,3 +1,18 @@
+0.3.4
+=====
+
+ * #73 - apparently 'package' is a reserved keyword (use 'pkg' instead)
+ * #93 - Coffescript can leak a variable when the same name is used
+ in catch statement. Let's always use 'x' as the variable in catch.
+ * #76 - decorateConnection could throw an error if remote connection
+ was closed before setup was complete
+ * #90 - Fix "TypeError: 'addListener'" exception (via @pl).
+ * #66 - Failure to post data to /xhr_send should kill the session
+ * remove 'optionalDependencies' section from package.json,
+ 'rbytes' was always optional.
+ * #91 - Fix rare null exception.
+
+
0.3.3
=====
View
@@ -11,7 +11,7 @@ Work in progress:
* [SockJS-ruby](https://github.com/sockjs/sockjs-ruby)
* [SockJS-netty](https://github.com/cgbystrom/sockjs-netty)
- * [SockJS-gevent](https://github.com/sdiehl/sockjs-gevent)
+ * [SockJS-gevent](https://github.com/sdiehl/sockjs-gevent) ([and a fork](https://github.com/njoyce/sockjs-gevent))
* [pyramid-SockJS](https://github.com/fafhrd91/pyramid_sockjs)
* [wildcloud-websockets](https://github.com/wildcloud/wildcloud-websockets)
* [SockJS-cyclone](https://github.com/flaviogrossi/sockjs-cyclone)
@@ -39,7 +39,11 @@ To install `sockjs-node` run:
npm install sockjs
-(If you see `rbytes` dependecy failing, don't worry, it's optional, SockJS-node will work fine without it.)
+For additional security (true random numbers) you might want to
+install `rbytes` package - SockJS will use it if available:
+
+ npm install rbytes
+
An simplified echo SockJS server could look more or less like:
View
@@ -1,7 +1,7 @@
{
"name" : "sockjs",
"author" : "Marek Majkowski",
- "version" : "0.3.3",
+ "version" : "0.3.4",
"description" : "SockJS-node is a server counterpart of SockJS-client a JavaScript library that provides a WebSocket-like object in the browser. SockJS gives you a coherent, cross-browser, Javascript API which creates a low latency, full duplex, cross-domain communication channel between the browser and the web server.",
"keywords" : ["websockets", "websocket"],
"homepage" : "https://github.com/sockjs/sockjs-node",
@@ -12,9 +12,6 @@
"node-uuid" : "1.3.3",
"faye-websocket" : "0.4.0"
},
- "optionalDependencies": {
- "rbytes" : "0.0.2"
- },
"devDependencies": {
"coffee-script" : "1.2.x"
},
@@ -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
@@ -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
@@ -11,8 +11,8 @@ class JsonpReceiver extends transport.ResponseReceiver
max_response_size: 1
polling: true
- 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
@@ -39,7 +39,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
@@ -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
@@ -391,12 +391,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 e6a3ab4

Please sign in to comment.