Skip to content

Commit

Permalink
Merge remote branch 'origin/v0.6'
Browse files Browse the repository at this point in the history
Conflicts:
	deps/v8/src/debug.cc
	deps/v8/src/version.cc
	src/node_version.h
  • Loading branch information
ry committed Dec 6, 2011
2 parents e609195 + 580e670 commit 2003593
Show file tree
Hide file tree
Showing 27 changed files with 248 additions and 34 deletions.
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: node_js

before_script:
- "./configure"
- "make"

script:
- "make test"

notifications:
email: false
irc:
- "irc.freenode.net#libuv"

7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2011.12.04, Version 0.6.5 (stable)

* npm workaround Windows antivirus software (isaacs)

* Upgrade V8 to 3.6.6.11


2011.12.02, Version 0.6.4 (stable), 9170077f13e5e5475b23d1d3c2e7f69bfe139727

* doc improvements (Kyle Young, Tim Oxley, Roman Shtylman, Mathias Bynens)
Expand Down
6 changes: 3 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ The externally maintained libraries used by Node are:
licensed under a permissive free software license. See
deps/zlib/LICENSE.

- deps/npm NPM is a package manager program copyright 2009, 2010, 2011
Isaac Z. Schlueter and licensed under MIT. NPM includes several
- deps/npm npm is a package manager program copyright 2009, 2010, 2011
Isaac Z. Schlueter and licensed under MIT. npm includes several
subpackages MIT or Apache licenses, see deps/npm/LICENSE for more
information. NPM is included in the Node .msi and .pkg distributions
information. npm is included in the Node .msi and .pkg distributions
but not in the Node binary itself.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Evented I/O for V8 javascript.
Evented I/O for V8 javascript. [![Build Status](https://secure.travis-ci.org/joyent/node.png)](http://travis-ci.org/joyent/node)
===

### To build:
Expand Down
21 changes: 20 additions & 1 deletion deps/npm/lib/utils/tar.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ function unpack_ ( tarball, unpackTarget, dMode, fMode, uid, gid, cb ) {
rm(unpackTarget, function (er) {
if (er) return cb(er)
log.verbose(unpackTarget, "rm'ed")
fs.rename(folder, unpackTarget, function (er) {

moveIntoPlace(folder, unpackTarget, function (er) {
if (er) return cb(er)
log.verbose([folder, unpackTarget], "renamed")
// curse you, nfs! It will lie and tell you that the
Expand All @@ -161,6 +162,24 @@ function unpack_ ( tarball, unpackTarget, dMode, fMode, uid, gid, cb ) {
})
}

// on Windows, A/V software can lock the directory, causing this
// to fail with an EACCES. Try again on failure, for up to 1 second.
// XXX Fix this by not unpacking into a temp directory, instead just
// renaming things on the way out of the tarball.
function moveIntoPlace (folder, unpackTarget, cb) {
var start = Date.now()
fs.rename(folder, unpackTarget, function CB (er) {
if (er
&& process.platform === "win32"
&& er.code === "EACCES"
&& Date.now() - start < 1000) {
return fs.rename(folder, unpackTarget, CB)
}
cb(er)
})
}


function gunzTarPerm (tarball, tmp, dMode, fMode, uid, gid, cb) {
if (!dMode) dMode = npm.modes.exec
if (!fMode) fMode = npm.modes.file
Expand Down
10 changes: 9 additions & 1 deletion deps/uv/src/unix/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,15 @@ uv_loop_t* uv_loop_new(void) {
void uv_loop_delete(uv_loop_t* loop) {
uv_ares_destroy(loop, loop->channel);
ev_loop_destroy(loop->ev);
free(loop);

#ifndef NDEBUG
memset(loop, 0, sizeof *loop);
#endif

if (loop == default_loop_ptr)
default_loop_ptr = NULL;
else
free(loop);
}


Expand Down
1 change: 1 addition & 0 deletions deps/uv/src/unix/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case EHOSTUNREACH: return UV_EHOSTUNREACH;
case EAI_NONAME: return UV_ENOENT;
case ESRCH: return UV_ESRCH;
case ETIMEDOUT: return UV_ETIMEDOUT;
default: return UV_UNKNOWN;
}

Expand Down
4 changes: 4 additions & 0 deletions deps/v8/test/mjsunit/mjsunit.status
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ bugs: FAIL
# Fails.
regress/regress-1119: FAIL

#############################################################################
# Fails due to r10102 which reverts precise stepping on the 3.6 branch.
debug-step-2: FAIL

##############################################################################

# Issue 1845: http://code.google.com/p/v8/issues/detail?id=1845
Expand Down
15 changes: 8 additions & 7 deletions doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<li><a href="#download">Download</a></li>
<li><a href="https://github.com/joyent/node/wiki/ChangeLog">ChangeLog</a></li>
<li><a href="#about">About</a></li>
<li><a href="http://nodejs.org/docs/v0.6.4/api">v0.6.4 docs</a></li>
<li><a href="http://nodejs.org/docs/v0.6.5/api">v0.6.5 docs</a></li>
<br/>
<li><a href="https://github.com/joyent/node/wiki">Wiki</a></li>
<li><a href="http://blog.nodejs.org/">Blog</a></li>
Expand Down Expand Up @@ -105,14 +105,15 @@ <h2 id="video">Introduction</h2>

<h2 id="download">Download</h2>

<p>2011.12.02 v0.6.4
<p>2011.12.04 v0.6.5
<ul class="release">
<li><a href="http://nodejs.org/dist/v0.6.4/node-v0.6.4.tar.gz"><code>node-v0.6.4.tar.gz</code>
<li><a href="http://nodejs.org/dist/v0.6.5/node-v0.6.5.tar.gz"><code>node-v0.6.5.tar.gz</code>
Source code</a> (<a href="https://github.com/joyent/node/wiki/Installation">build instructions</a>)
<li><a href="http://nodejs.org/dist/v0.6.4/node-v0.6.4.msi"><code>node-v0.6.4.msi</code> Windows installer</a>
<li><a href="http://nodejs.org/dist/v0.6.4/node-v0.6.4.pkg"><code>node-v0.6.4.pkg</code> Macintosh installer</a>
<li><a href="http://nodejs.org/docs/v0.6.4/api/index.html">Documentation</a>
<li><a href="http://nodejs.org/dist/v0.6.4">Other release files
<li><a href="http://nodejs.org/dist/v0.6.5/node-v0.6.5.msi"><code>node-v0.6.5.msi</code> Windows installer</a>
<li><a href="http://nodejs.org/dist/v0.6.5/node-v0.6.5.pkg"><code>node-v0.6.5.pkg</code> Macintosh installer</a>
<li><a href="http://nodejs.org/docs/v0.6.5/api/index.html">Documentation</a>
<li><a href="https://raw.github.com/joyent/node/v0.6.5/LICENSE">License</a>
<li><a href="http://nodejs.org/dist/v0.6.5">Other release files
(like <code>.exe</code> and <code>.pdb</code>)</a>
</ul>

Expand Down
15 changes: 13 additions & 2 deletions doc/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<html>
<head>
<meta charset="UTF-8" />
<title>{{section}}Node.js v0.6.4 Manual &amp; Documentation</title>
<title>{{section}}Node.js v0.6.5 Manual &amp; Documentation</title>
<link rel="stylesheet" href="assets/style.css" />
<link rel="stylesheet" href="assets/sh.css" />
<link rel="canonical" href="http://nodejs.org/docs/latest/api/{{filename}}.html"/>
</head>
<body>
<div id="container">
<header>
<h1>Node.js v0.6.4 Manual &amp; Documentation</h1>
<h1>Node.js v0.6.5 Manual &amp; Documentation</h1>
<div id="gtoc">
<p><a href="index.html">Index</a> | <a href="all.html">View on single page</a></p>
</div>
Expand All @@ -21,5 +21,16 @@ <h1>Node.js v0.6.4 Manual &amp; Documentation</h1>
<script src="assets/sh_main.js"></script>
<script src="assets/sh_javascript.min.js"></script>
<script>highlight(undefined, undefined, 'pre');</script>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ?
"https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-10874194-2");
pageTracker._trackPageview();
} catch(err) {}</script>
<script type="text/javascript">highlight(undefined, undefined, 'pre');</script>
</body>
</html>
2 changes: 1 addition & 1 deletion doc/v0.4_announcement.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h2>Second Stable Branch of Node released</h2>

<li> With a good amount of experience now, some modifications to the
module loading system were made to better support package managers.
In particular, NPM was forced to resort to deep symlinks and "shim"
In particular, npm was forced to resort to deep symlinks and "shim"
modules to work around missing features in <code>require()</code>. The main
changes are:
<ol>
Expand Down
2 changes: 1 addition & 1 deletion lib/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var Pipe;
function createPipe(ipc) {
// Lazy load
if (!Pipe) {
Pipe = new process.binding('pipe_wrap').Pipe;
Pipe = process.binding('pipe_wrap').Pipe;
}

return new Pipe(ipc);
Expand Down
16 changes: 14 additions & 2 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function Socket(options) {

if (typeof options == 'number') {
// Legacy interface.
// Must support legacy interface. NPM depends on it.
// Must support legacy interface. Old versions of npm depend on it.
// https://github.com/isaacs/npm/blob/c7824f412f0cb59d6f55cf0bc220253c39e6029f/lib/utils/output.js#L110
var fd = options;

Expand Down Expand Up @@ -194,13 +194,25 @@ Object.defineProperty(Socket.prototype, 'bufferSize', {


Socket.prototype.pause = function() {
this._handle.readStop();
if (this._handle) {
this._handle.readStop();

// this adds an undesireable boundary crossing for pipe streams.
// the .unref() method is omitted on TCP streams, because it is
// unnecessary.
if (this._handle.unref) this._handle.unref();
}
};


Socket.prototype.resume = function() {
if (this._handle) {
this._handle.readStart();

// this adds an undesireable boundary crossing for pipe streams.
// the .ref() method is omitted on TCP streams, because it is
// unnecessary.
if (this._handle.ref) this._handle.ref();
}
};

Expand Down
11 changes: 11 additions & 0 deletions lib/tty.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,19 @@ function ReadStream(fd) {
this.on('newListener', onNewListener);
}
inherits(ReadStream, net.Socket);

exports.ReadStream = ReadStream;

ReadStream.prototype.pause = function() {
this._handle.unref();
return net.Socket.prototype.pause.call(this);
};

ReadStream.prototype.resume = function() {
this._handle.ref();
return net.Socket.prototype.resume.call(this);
};


ReadStream.prototype.isTTY = true;

Expand Down
30 changes: 24 additions & 6 deletions src/handle_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ Handle<Value> HandleWrap::Unref(const Arguments& args) {

UNWRAP

// Calling this function twice should never happen.
assert(wrap->unref == false);
// Calling unnecessarily is a no-op
if (wrap->unref) {
return v8::Undefined();
}

wrap->unref = true;
uv_unref(uv_default_loop());
Expand All @@ -74,6 +76,24 @@ Handle<Value> HandleWrap::Unref(const Arguments& args) {
}


// Adds a reference to keep uv alive because of this thing.
Handle<Value> HandleWrap::Ref(const Arguments& args) {
HandleScope scope;

UNWRAP

// Calling multiple times is a no-op
if (!wrap->unref) {
return v8::Undefined();
}

wrap->unref = false;
uv_ref(uv_default_loop());

return v8::Undefined();
}


Handle<Value> HandleWrap::Close(const Arguments& args) {
HandleScope scope;

Expand All @@ -82,10 +102,8 @@ Handle<Value> HandleWrap::Close(const Arguments& args) {
assert(!wrap->object_.IsEmpty());
uv_close(wrap->handle__, OnClose);

if (wrap->unref) {
uv_ref(uv_default_loop());
wrap->unref = false;
}

HandleWrap::Ref(args);

wrap->StateChange();

Expand Down
1 change: 1 addition & 0 deletions src/handle_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class HandleWrap {
static void Initialize(v8::Handle<v8::Object> target);
static v8::Handle<v8::Value> Close(const v8::Arguments& args);
static v8::Handle<v8::Value> Unref(const v8::Arguments& args);
static v8::Handle<v8::Value> Ref(const v8::Arguments& args);

protected:
HandleWrap(v8::Handle<v8::Object> object, uv_handle_t* handle);
Expand Down
6 changes: 5 additions & 1 deletion src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2217,8 +2217,12 @@ static void PrintHelp() {
" --vars print various compiled-in variables\n"
" --max-stack-size=val set max v8 stack size (bytes)\n"
"\n"
"Enviromental variables:\n"
"Environment variables:\n"
#ifdef _WIN32
"NODE_PATH ';'-separated list of directories\n"
#else
"NODE_PATH ':'-separated list of directories\n"
#endif
" prefixed to the module search path.\n"
"NODE_MODULE_CONTEXTS Set to 1 to load modules in their own\n"
" global contexts.\n"
Expand Down
7 changes: 6 additions & 1 deletion src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,13 @@
};

startup.processKillAndExit = function() {
var exiting = false;

process.exit = function(code) {
process.emit('exit', code || 0);
if (!exiting) {
exiting = true;
process.emit('exit', code || 0);
}
process.reallyExit(code || 0);
};

Expand Down
1 change: 1 addition & 0 deletions src/pipe_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ void PipeWrap::Initialize(Handle<Object> target) {

NODE_SET_PROTOTYPE_METHOD(t, "close", HandleWrap::Close);
NODE_SET_PROTOTYPE_METHOD(t, "unref", HandleWrap::Unref);
NODE_SET_PROTOTYPE_METHOD(t, "ref", HandleWrap::Ref);

NODE_SET_PROTOTYPE_METHOD(t, "readStart", StreamWrap::ReadStart);
NODE_SET_PROTOTYPE_METHOD(t, "readStop", StreamWrap::ReadStop);
Expand Down
1 change: 1 addition & 0 deletions src/tty_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class TTYWrap : StreamWrap {

NODE_SET_PROTOTYPE_METHOD(t, "close", HandleWrap::Close);
NODE_SET_PROTOTYPE_METHOD(t, "unref", HandleWrap::Unref);
NODE_SET_PROTOTYPE_METHOD(t, "ref", HandleWrap::Ref);

NODE_SET_PROTOTYPE_METHOD(t, "readStart", StreamWrap::ReadStart);
NODE_SET_PROTOTYPE_METHOD(t, "readStop", StreamWrap::ReadStop);
Expand Down
6 changes: 3 additions & 3 deletions test/simple/test-fs-long-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

var common = require('../common');
var fs = require('fs');
var path = require('path');
var assert = require('assert');

var successes = 0;

// make a path that will be at least 260 chars long.
var cwd = process.cwd();
var fileNameLen = Math.max(260 - cwd.length - 1, 1);
var fileName = new Array(fileNameLen + 1).join('x');
var fileNameLen = Math.max(260 - common.tmpDir.length - 1, 1);
var fileName = path.join(common.tmpDir, new Array(fileNameLen + 1).join('x'));
var fullPath = path.resolve(fileName);

console.log({ filenameLength: fileName.length,
Expand Down
Loading

0 comments on commit 2003593

Please sign in to comment.