Skip to content

Commit

Permalink
Merge branch 'v0.4'
Browse files Browse the repository at this point in the history
Conflicts:
	src/node_version.h
  • Loading branch information
ry committed Feb 20, 2011
2 parents 0aa1a8a + e5a4722 commit 7dad30a
Show file tree
Hide file tree
Showing 12 changed files with 97 additions and 16 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,4 @@ Joe Walnes <joe@walnes.com>
Koichi Kobayashi <koichik@improvement.jp>
Daniel Gröber <dxld@darkboxed.org>
Konstantin Käfer <github@kkaefer.com>
Richard Rodger <richard@ricebridge.com>
32 changes: 31 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,36 @@
2011.02.19, Version 0.4.1 (stable)

* Fixed field merging with progressive fields on writeHead()
(TJ Holowaychuk)

* Make the repl respect node_modules folders (isaacs)

* Fix for DNS fail in HTTP request (Richard Rodger)

* Default to port 80 for http.request and http.get.

* Improve V8 support for Cygwin (Bert Belder)

* Fix fs.open param parsing. (Felix Geisendörfer)

* Fixed null signal.

* Fix various HTTP and HTTPS bugs

* cmake improvements (Tom Hughes)

* Fix: TLS sockets should not be writable after 'end'

* Fix os.cpus() on cygwin (Brian White)

* MinGW: OpenSSL support (Bert Belder)

* Upgrade V8 to 3.1.5, libev to 4.4.


2011.02.10, Version 0.4.0 (stable)

* require() improvements (isaacs)
* require() improvements (isaacs)
- understand package.json (isaacs)
- look for 'node_modules' dir

Expand Down
8 changes: 4 additions & 4 deletions doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<li><a href="#download">Download</a></li>
<li><a href="https://github.com/ry/node/raw/master/ChangeLog">ChangeLog</a></li>
<li><a href="#about">About</a></li>
<li><a href="http://nodejs.org/docs/v0.4.0/api">v0.4.0 docs</a></li>
<li><a href="http://nodejs.org/docs/v0.4.1/api">v0.4.1 docs</a></li>
<br/>
<li><B><a href="https://github.com/ry/node/wiki">Wiki</a></B></li>
</ol>
Expand Down Expand Up @@ -90,9 +90,9 @@ <h2 id="download">Download</h2>
</p>

<p>
2011.02.10
<a href="http://nodejs.org/dist/node-v0.4.0.tar.gz">node-v0.4.0.tar.gz</a>
(<a href="http://nodejs.org/docs/v0.4.0/api/index.html">Documentation</a>)
2011.02.19
<a href="http://nodejs.org/dist/node-v0.4.1.tar.gz">node-v0.4.1.tar.gz</a>
(<a href="http://nodejs.org/docs/v0.4.1/api/index.html">Documentation</a>)
</p>

<p>Historical: <a href="http://nodejs.org/dist">versions</a>, <a href="http://nodejs.org/docs">docs</a></p>
Expand Down
3 changes: 3 additions & 0 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,9 @@ ReadStream.prototype.resume = function() {
this.buffer = null;
}

// hasn't opened yet.
if (null == this.fd) return;

this._read();
};

Expand Down
3 changes: 2 additions & 1 deletion lib/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,8 @@ Agent.prototype._establishNewConnection = function() {
// but outgoingFlush instead.
if (!req.shouldKeepAlive) {
debug('AGENT socket.end()');
socket.end();
if (socket.writable) socket.end();
assert(!socket.writable);
} else {
debug('AGENT socket keep-alive');
}
Expand Down
3 changes: 3 additions & 0 deletions lib/tls.js
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,9 @@ SecurePair.prototype._destroy = function() {
this._ssl.close();
this._ssl = null;

self.encrypted.writable = self.encrypted.readable = false;
self.cleartext.writable = self.cleartext.readable = false;

process.nextTick(function() {
self.encrypted.emit('end');
if (self.encrypted.onend) self.encrypted.onend();
Expand Down
12 changes: 8 additions & 4 deletions src/platform_cygwin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ static inline char* _getProcessTitle() {
if (GetLastError()) {
_winapi_perror("GetConsoleTitleW");
return NULL;
}
else {
} else {
// The title is empty, so return empty string
process_title = strdup("\0");
return process_title;
Expand Down Expand Up @@ -252,6 +251,7 @@ int Platform::GetExecutablePath(char* buffer, size_t* size) {
}

int Platform::GetCPUInfo(Local<Array> *cpus) {
HandleScope scope;
Local<Object> cpuinfo;
Local<Object> cputimes;
unsigned int ticks = (unsigned int)sysconf(_SC_CLK_TCK),
Expand Down Expand Up @@ -285,14 +285,17 @@ int Platform::GetCPUInfo(Local<Array> *cpus) {

if (fpStat) {
while (fgets(line, 511, fpStat) != NULL) {
if (strncmp(line, "cpu ", 4) == 0)
if (strncmp(line, "cpu ", 4) == 0) {
continue;
else if (strncmp(line, "intr ", 5) == 0)
} else if (strncmp(line, "cpu", 3) != 0) {
break;
}

sscanf(line, "%*s %llu %llu %llu %llu",
&ticks_user, &ticks_nice, &ticks_sys, &ticks_idle);
snprintf(speedPath, sizeof(speedPath),
"/sys/devices/system/cpu/cpu%u/cpufreq/cpuinfo_max_freq", i);

fpSpeed = fopen(speedPath, "r");
if (fpSpeed) {
if (fgets(line, 511, fpSpeed) != NULL) {
Expand Down Expand Up @@ -355,4 +358,5 @@ int Platform::GetLoadAvg(Local<Array> *loads) {
return -1;
}


} // namespace node
9 changes: 7 additions & 2 deletions src/platform_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -183,22 +183,27 @@ int Platform::GetCPUInfo(Local<Array> *cpus) {

if (fpStat) {
while (fgets(line, 511, fpStat) != NULL) {
if (strncmp(line, "cpu ", 4) == 0)
if (strncmp(line, "cpu ", 4) == 0) {
continue;
else if (strncmp(line, "intr ", 5) == 0)
} else if (strncmp(line, "cpu", 3) != 0) {
break;
}

sscanf(line, "%*s %llu %llu %llu %llu %*llu %llu",
&ticks_user, &ticks_nice, &ticks_sys, &ticks_idle, &ticks_intr);
snprintf(speedPath, sizeof(speedPath),
"/sys/devices/system/cpu/cpu%u/cpufreq/cpuinfo_max_freq", i);

fpSpeed = fopen(speedPath, "r");

if (fpSpeed) {
if (fgets(line, 511, fpSpeed) != NULL) {
sscanf(line, "%u", &cpuspeed);
cpuspeed /= 1000;
}
fclose(fpSpeed);
}

cpuinfo = Object::New();
cputimes = Object::New();
cputimes->Set(String::New("user"), Number::New(ticks_user * multiplier));
Expand Down
31 changes: 31 additions & 0 deletions test/disabled/test-https-loop-to-google.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Failing test for https

// Will fail with "socket hang up" for 4 out of 10 requests
// Tested on node 0.5.0-pre commit 9851574


var https = require('https');

for(var i = 0; i < 10; ++i)
{
https.get(
{
host: 'www.google.com',
path: '/accounts/o8/id',
port: 443,
}, function(res)
{
var data = '';
res.on('data', function(chunk)
{
data += chunk;
});
res.on('end', function()
{
console.log(res.statusCode);
});
}).on('error', function(error)
{
console.log(error);
});
}
5 changes: 5 additions & 0 deletions test/simple/test-fs-read-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,8 @@ stream.on('data', function(chunk) {
stream.on('end', function() {
assert.equal('x', stream.data);
});

// pause and then resume immediately.
var pauseRes = fs.createReadStream(rangeFile);
pauseRes.pause();
pauseRes.resume();
4 changes: 1 addition & 3 deletions test/simple/test-tls-securepair-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ var server = net.createServer(function(socket) {

socket.on('end', function() {
log('socket end');
pair.cleartext.write('goodbye\r\n');
pair.cleartext.end();
});

pair.cleartext.on('error', function(err) {
Expand Down Expand Up @@ -117,7 +115,7 @@ server.listen(common.PORT, function() {
}
});

client.stdout.pipe(process.stdout);
client.stdout.pipe(process.stdout, { end: false });

client.on('exit', function(code) {
opensslExitCode = code;
Expand Down
2 changes: 1 addition & 1 deletion wscript
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ def build(bld):
, 'CPPFLAGS' : " ".join(program.env["CPPFLAGS"]).replace('"', '\\"')
, 'LIBFLAGS' : " ".join(program.env["LIBFLAGS"]).replace('"', '\\"')
, 'PREFIX' : safe_path(program.env["PREFIX"])
, 'VERSION' : '0.4.0' # FIXME should not be hard-coded, see NODE_VERSION_STRING in src/node_version.
, 'VERSION' : '0.4.1' # FIXME should not be hard-coded, see NODE_VERSION_STRING in src/node_version.
}
return x

Expand Down

0 comments on commit 7dad30a

Please sign in to comment.