[Pkg-javascript-commits] [sockjs-client] 260/434: Fix #34 - Don't reuse `session_id`.
Tonnerre Lombard
tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:18 UTC 2014
This is an automated email from the git hooks/post-receive script.
tonnerre-guest pushed a commit to branch master
in repository sockjs-client.
commit 92e56786c120e68c98dde3088f37a52bf3072547
Author: Marek Majkowski <majek04 at gmail.com>
Date: Wed Dec 14 13:24:09 2011 +0000
Fix #34 - Don't reuse `session_id`.
---
Changelog | 2 ++
lib/sockjs.js | 10 +++++-----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/Changelog b/Changelog
index c6f178a..ffa705b 100644
--- a/Changelog
+++ b/Changelog
@@ -1,6 +1,8 @@
dev
===
+ * #34 - Don't ever reuse `session_id`, especially when trying
+ fallback protocols.
* The test server got moved from SockJS-client to SockJS-node.
diff --git a/lib/sockjs.js b/lib/sockjs.js
index 5f7b7bd..6202dc1 100644
--- a/lib/sockjs.js
+++ b/lib/sockjs.js
@@ -6,8 +6,6 @@ var SockJS = function(url, protocols, options) {
}
that._base_url = utils.amendUrl(url);
that._server = that._options.server || utils.random_number_string(1000);
- that._connid = utils.random_string(8);
- that._trans_url = that._base_url + '/' + that._server + '/' + that._connid;
that._protocols = ['websocket',
'xhr-streaming',
'iframe-eventsource',
@@ -185,9 +183,11 @@ SockJS.prototype._try_next_protocol = function(close_event) {
!SockJS[protocol].enabled(that._options)) {
that._debug('Skipping transport:', protocol);
} else {
- that._debug('Opening transport:', protocol);
- that._transport = new SockJS[protocol](that, that._trans_url,
- that._base_url);
+ var connid = utils.random_string(8);
+ var trans_url = that._base_url + '/' + that._server + '/' + connid;
+ that._debug('Opening transport:', protocol, ' url:', trans_url);
+ that._transport = new SockJS[protocol](that, trans_url,
+ that._base_url);
return true;
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git
More information about the Pkg-javascript-commits
mailing list