Skip to content
This repository
Browse code

Merge branch 'master' into dev

  • Loading branch information...
commit e6a3ab4d7a0ae8f9e2fd7b5a0afd2d3f736c4125 2 parents f83f99f + 519e960
Marek authored November 15, 2012
15  Changelog
... ...
@@ -1,3 +1,18 @@
  1
+0.3.4
  2
+=====
  3
+
  4
+ * #73 - apparently 'package' is a reserved keyword (use 'pkg' instead)
  5
+ * #93 - Coffescript can leak a variable when the same name is used
  6
+   in catch statement. Let's always use 'x' as the variable in catch.
  7
+ * #76 - decorateConnection could throw an error if remote connection
  8
+   was closed before setup was complete
  9
+ * #90 - Fix "TypeError: 'addListener'" exception (via @pl).
  10
+ * #66 - Failure to post data to /xhr_send should kill the session
  11
+ * remove 'optionalDependencies' section from package.json,
  12
+   'rbytes' was always optional.
  13
+ * #91 - Fix rare null exception.
  14
+
  15
+
1 16
 0.3.3
2 17
 =====
3 18
 
8  README.md
Source Rendered
@@ -11,7 +11,7 @@ Work in progress:
11 11
 
12 12
   * [SockJS-ruby](https://github.com/sockjs/sockjs-ruby)
13 13
   * [SockJS-netty](https://github.com/cgbystrom/sockjs-netty)
14  
-  * [SockJS-gevent](https://github.com/sdiehl/sockjs-gevent)
  14
+  * [SockJS-gevent](https://github.com/sdiehl/sockjs-gevent) ([and a fork](https://github.com/njoyce/sockjs-gevent))
15 15
   * [pyramid-SockJS](https://github.com/fafhrd91/pyramid_sockjs)
16 16
   * [wildcloud-websockets](https://github.com/wildcloud/wildcloud-websockets)
17 17
   * [SockJS-cyclone](https://github.com/flaviogrossi/sockjs-cyclone)
@@ -39,7 +39,11 @@ To install `sockjs-node` run:
39 39
 
40 40
     npm install sockjs
41 41
 
42  
-(If you see `rbytes` dependecy failing, don't worry, it's optional, SockJS-node will work fine without it.)
  42
+For additional security (true random numbers) you might want to
  43
+install `rbytes` package - SockJS will use it if available:
  44
+
  45
+    npm install rbytes
  46
+
43 47
 
44 48
 An simplified echo SockJS server could look more or less like:
45 49
 
5  package.json
... ...
@@ -1,7 +1,7 @@
1 1
 {
2 2
     "name"        : "sockjs",
3 3
     "author"      : "Marek Majkowski",
4  
-    "version"     : "0.3.3",
  4
+    "version"     : "0.3.4",
5 5
     "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.",
6 6
     "keywords"    : ["websockets", "websocket"],
7 7
     "homepage"    : "https://github.com/sockjs/sockjs-node",
@@ -12,9 +12,6 @@
12 12
         "node-uuid"      : "1.3.3",
13 13
         "faye-websocket" : "0.4.0"
14 14
     },
15  
-    "optionalDependencies": {
16  
-        "rbytes"         : "0.0.2"
17  
-    },
18 15
     "devDependencies": {
19 16
         "coffee-script"  : "1.2.x"
20 17
     },
2  src/trans-eventsource.coffee
@@ -25,5 +25,5 @@ exports.app =
25 25
         # Opera needs one more new line at the start.
26 26
         res.write('\r\n')
27 27
 
28  
-        transport.register(req, @, new EventSourceReceiver(res, @options))
  28
+        transport.register(req, @, new EventSourceReceiver(req, res, @options))
29 29
         return true
2  src/trans-htmlfile.coffee
@@ -56,5 +56,5 @@ exports.app =
56 56
         res.writeHead(200)
57 57
         res.write(iframe_template.replace(/{{ callback }}/g, callback));
58 58
 
59  
-        transport.register(req, @, new HtmlFileReceiver(res, @options))
  59
+        transport.register(req, @, new HtmlFileReceiver(req, res, @options))
60 60
         return true
6  src/trans-jsonp.coffee
@@ -11,8 +11,8 @@ class JsonpReceiver extends transport.ResponseReceiver
11 11
     max_response_size: 1
12 12
     polling: true
13 13
 
14  
-    constructor: (res, options, @callback) ->
15  
-        super(res, options)
  14
+    constructor: (req, res, options, @callback) ->
  15
+        super(req, res, options)
16 16
 
17 17
     doSendFrame: (payload) ->
18 18
         # Yes, JSONed twice, there isn't a a better way, we must pass
@@ -39,7 +39,7 @@ exports.app =
39 39
         res.setHeader('Content-Type', 'application/javascript; charset=UTF-8')
40 40
         res.writeHead(200)
41 41
 
42  
-        transport.register(req, @, new JsonpReceiver(res, @options, callback))
  42
+        transport.register(req, @, new JsonpReceiver(req, res, @options, callback))
43 43
         return true
44 44
 
45 45
     jsonp_send: (req, res, query) ->
4  src/trans-xhr.coffee
@@ -72,7 +72,7 @@ exports.app =
72 72
         res.setHeader('Content-Type', 'application/javascript; charset=UTF-8')
73 73
         res.writeHead(200)
74 74
 
75  
-        transport.register(req, @, new XhrPollingReceiver(res, @options))
  75
+        transport.register(req, @, new XhrPollingReceiver(req, res, @options))
76 76
         return true
77 77
 
78 78
     xhr_streaming: (req, res, _, next_filter) ->
@@ -83,5 +83,5 @@ exports.app =
83 83
         #  http://blogs.msdn.com/b/ieinternals/archive/2010/04/06/comet-streaming-in-internet-explorer-with-xmlhttprequest-and-xdomainrequest.aspx
84 84
         res.write(Array(2049).join('h') + '\n')
85 85
 
86  
-        transport.register(req, @, new XhrStreamingReceiver(res, @options) )
  86
+        transport.register(req, @, new XhrStreamingReceiver(req, res, @options) )
87 87
         return true
6  src/transport.coffee
@@ -391,12 +391,12 @@ class GenericReceiver
391 391
 class ResponseReceiver extends GenericReceiver
392 392
     max_response_size: undefined
393 393
 
394  
-    constructor: (@response, @options) ->
  394
+    constructor: (@request, @response, @options) ->
395 395
         @curr_response_size = 0
396 396
         try
397  
-            @response.connection.setKeepAlive(true, 5000)
  397
+            @request.connection.setKeepAlive(true, 5000)
398 398
         catch x
399  
-        super (@response.connection)
  399
+        super (@request.connection)
400 400
         if @max_response_size is undefined
401 401
             @max_response_size = @options.response_limit
402 402
 

0 notes on commit e6a3ab4

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