Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'refs/heads/master' into performance

  • Loading branch information...
commit b4d7fb0617ab9cc02b1549e6c08601c4d8a41f4c 2 parents 5479af1 + 0cb5acb
@n1mmy n1mmy authored
View
94 admin/generate-dev-bundle.sh
@@ -2,14 +2,14 @@
set -e
-BUNDLE_VERSION=0.0.5
+BUNDLE_VERSION=0.0.6
UNAME=$(uname)
if [ "$UNAME" == "Linux" ] ; then
- MONGO_NAME="mongodb-linux-x86_64-2.0.1"
+ MONGO_NAME="mongodb-linux-x86_64-2.0.2"
MONGO_URL="http://fastdl.mongodb.org/linux/${MONGO_NAME}.tgz"
elif [ "$UNAME" == "Darwin" ] ; then
- MONGO_NAME="mongodb-osx-x86_64-2.0.1"
+ MONGO_NAME="mongodb-osx-x86_64-2.0.2"
MONGO_URL="http://fastdl.mongodb.org/osx/${MONGO_NAME}.tgz"
else
echo "This OS not yet supported"
@@ -32,41 +32,7 @@ cd build
git clone git://github.com/joyent/node.git
cd node
-git checkout v0.6.5
-
-# Disable obnoxious print. No easy way to disable that I found.
-patch -p1 <<EOF
-diff --git a/lib/sys.js b/lib/sys.js
-index c37e2a7..d4e71bc 100644
---- a/lib/sys.js
-+++ b/lib/sys.js
-@@ -21,15 +21,16 @@
-
- var util = require('util');
-
--var sysWarning;
--if (!sysWarning) {
-- sysWarning = 'The "sys" module is now called "util". ' +
-- 'It should have a similar interface.';
-- if (process.env.NODE_DEBUG && process.env.NODE_DEBUG.indexOf('sys') != -1)
-- console.trace(sysWarning);
-- else
-- console.error(sysWarning);
--}
-+// XXX Skybreak disabled
-+// var sysWarning;
-+// if (!sysWarning) {
-+// sysWarning = 'The "sys" module is now called "util". ' +
-+// 'It should have a similar interface.';
-+// if (process.env.NODE_DEBUG && process.env.NODE_DEBUG.indexOf('sys') != -1)
-+// console.trace(sysWarning);
-+// else
-+// console.error(sysWarning);
-+// }
-
- exports.print = util.print;
- exports.puts = util.puts;
-EOF
+git checkout v0.6.7
export JOBS=4
./configure --prefix="$DIR"
@@ -81,29 +47,24 @@ which node
which npm
cd "$DIR/lib/node_modules"
-npm install connect@1.8.2
+npm install connect@1.8.5
npm install connect-gzip@0.1.5
-npm install optimist@0.2.8
+npm install optimist@0.3.1
npm install socket.io@0.8.7
-npm install coffee-script@1.1.3
-npm install less@1.1.5
+npm install coffee-script@1.2.0
+npm install less@1.2.0
npm install mime@1.2.4
-npm install semver@1.0.12
-npm install wrench@1.3.2
+npm install semver@1.0.13
+npm install wrench@1.3.3
npm install handlebars@1.0.2beta
npm install mongodb@0.9.7-1.4
-npm install uglify-js@1.1.1
-npm install clean-css@0.3.0
+npm install uglify-js@1.2.5
+npm install clean-css@0.3.1
npm install progress@0.0.4
-npm install fibers@0.6.3
-npm install useragent@1.0.3
-npm install request@2.2.9
-
-# patched versions to allow node 0.6.
-# This breaks websockets!
-# see https://github.com/nodejitsu/node-http-proxy/pull/152
-# and https://github.com/nodejitsu/node-http-proxy/tree/0.6-compatibility
-npm install 'git+https://github.com/lukasberns/node-http-proxy.git#2688d308bc'
+npm install fibers@0.6.4
+npm install useragent@1.0.5
+npm install request@2.9.3
+npm install http-proxy@0.8.0
cd "$DIR"
@@ -117,7 +78,7 @@ cd mongodb/bin
rm bsondump mongodump mongoexport mongofiles mongoimport mongorestore mongos mongosniff mongostat mongotop
cd ../..
-
+# Remove annoying print from socket.io that can't be disabled in config.
patch -p2 <<EOF
diff --git a/dev_bundle/lib/node_modules/socket.io/lib/manager.js b/dev_bundle/lib/node_modules/socket.io/lib/manager.js
index ee2bf49..a68f9cb 100644
@@ -134,6 +95,27 @@ index ee2bf49..a68f9cb 100644
Manager.prototype.__proto__ = EventEmitter.prototype
EOF
+# Patch an issue already fixed in socket.io master, but not released yet.
+# https://github.com/LearnBoost/socket.io-client/commit/7155d84af997dcfca418568dfcc778263926d7b2
+cd "$DIR/lib/node_modules/socket.io/node_modules/socket.io-client"
+patch -p1 <<EOF
+diff --git a/lib/socket.js b/lib/socket.js
+index 0f1b1c7..932beaa 100644
+--- a/lib/socket.js
++++ b/lib/socket.js
+@@ -405,7 +405,7 @@
+ Socket.prototype.onError = function (err) {
+ if (err && err.advice) {
+- if (err.advice === 'reconnect' && this.connected) {
++ if (this.options.reconnect && err.advice === 'reconnect' && this.connected) {
+ this.disconnect();
+ this.reconnect();
+ }
+EOF
+# rebuild
+make build
+
+
echo BUNDLING
cd "$DIR"
View
18 packages/stream/stream_client.js
@@ -102,12 +102,24 @@ if (typeof Sky === "undefined") Sky = {};
};
var cleanup_socket = function () {
if (socket) {
- socket.removeAllListeners('connect');
- socket.removeAllListeners('disconnect');
- socket.removeAllListeners('connect_failed');
+
+ if (socket.$events) {
+ _.each(socket.$events, function (v, k) {
+ socket.removeAllListeners(k);
+ });
+ }
socket.disconnect();
+
+ var old_socket = socket;
+ socket = undefined;
+
+ old_socket.on('connect', function () {
+ if (console) console.log("DEBUG: OLD SOCKET RECONNECTED", old_socket);
+ old_socket.disconnect();
+ });
}
};
+
var disconnected = function () {
if (connection_timer) {
clearTimeout(connection_timer);
View
2  skybreak
@@ -1,6 +1,6 @@
#!/bin/bash
-BUNDLE_VERSION=0.0.5
+BUNDLE_VERSION=0.0.6
# Find the script dir, following one level of symlink.
if [ -L "$0" ] ; then
Please sign in to comment.
Something went wrong with that request. Please try again.