Browse Source

Merge branch 'v0.4'

Conflicts:
	src/node_version.h
v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
7dad30afe9
  1. 1
      AUTHORS
  2. 32
      ChangeLog
  3. 8
      doc/index.html
  4. 3
      lib/fs.js
  5. 3
      lib/http.js
  6. 3
      lib/tls.js
  7. 12
      src/platform_cygwin.cc
  8. 9
      src/platform_linux.cc
  9. 31
      test/disabled/test-https-loop-to-google.js
  10. 5
      test/simple/test-fs-read-stream.js
  11. 4
      test/simple/test-tls-securepair-server.js
  12. 2
      wscript

1
AUTHORS

@ -161,3 +161,4 @@ Joe Walnes <joe@walnes.com>
Koichi Kobayashi <koichik@improvement.jp> Koichi Kobayashi <koichik@improvement.jp>
Daniel Gröber <dxld@darkboxed.org> Daniel Gröber <dxld@darkboxed.org>
Konstantin Käfer <github@kkaefer.com> Konstantin Käfer <github@kkaefer.com>
Richard Rodger <richard@ricebridge.com>

32
ChangeLog

@ -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) 2011.02.10, Version 0.4.0 (stable)
* require() improvements (isaacs) * require() improvements (isaacs)
- understand package.json (isaacs) - understand package.json (isaacs)
- look for 'node_modules' dir - look for 'node_modules' dir

8
doc/index.html

@ -20,7 +20,7 @@
<li><a href="#download">Download</a></li> <li><a href="#download">Download</a></li>
<li><a href="https://github.com/ry/node/raw/master/ChangeLog">ChangeLog</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="#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/> <br/>
<li><B><a href="https://github.com/ry/node/wiki">Wiki</a></B></li> <li><B><a href="https://github.com/ry/node/wiki">Wiki</a></B></li>
</ol> </ol>
@ -90,9 +90,9 @@ net.createServer(function (socket) {
</p> </p>
<p> <p>
2011.02.10 2011.02.19
<a href="http://nodejs.org/dist/node-v0.4.0.tar.gz">node-v0.4.0.tar.gz</a> <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.0/api/index.html">Documentation</a>) (<a href="http://nodejs.org/docs/v0.4.1/api/index.html">Documentation</a>)
</p> </p>
<p>Historical: <a href="http://nodejs.org/dist">versions</a>, <a href="http://nodejs.org/docs">docs</a></p> <p>Historical: <a href="http://nodejs.org/dist">versions</a>, <a href="http://nodejs.org/docs">docs</a></p>

3
lib/fs.js

@ -921,6 +921,9 @@ ReadStream.prototype.resume = function() {
this.buffer = null; this.buffer = null;
} }
// hasn't opened yet.
if (null == this.fd) return;
this._read(); this._read();
}; };

3
lib/http.js

@ -1282,7 +1282,8 @@ Agent.prototype._establishNewConnection = function() {
// but outgoingFlush instead. // but outgoingFlush instead.
if (!req.shouldKeepAlive) { if (!req.shouldKeepAlive) {
debug('AGENT socket.end()'); debug('AGENT socket.end()');
socket.end(); if (socket.writable) socket.end();
assert(!socket.writable);
} else { } else {
debug('AGENT socket keep-alive'); debug('AGENT socket keep-alive');
} }

3
lib/tls.js

@ -553,6 +553,9 @@ SecurePair.prototype._destroy = function() {
this._ssl.close(); this._ssl.close();
this._ssl = null; this._ssl = null;
self.encrypted.writable = self.encrypted.readable = false;
self.cleartext.writable = self.cleartext.readable = false;
process.nextTick(function() { process.nextTick(function() {
self.encrypted.emit('end'); self.encrypted.emit('end');
if (self.encrypted.onend) self.encrypted.onend(); if (self.encrypted.onend) self.encrypted.onend();

12
src/platform_cygwin.cc

@ -99,8 +99,7 @@ static inline char* _getProcessTitle() {
if (GetLastError()) { if (GetLastError()) {
_winapi_perror("GetConsoleTitleW"); _winapi_perror("GetConsoleTitleW");
return NULL; return NULL;
} } else {
else {
// The title is empty, so return empty string // The title is empty, so return empty string
process_title = strdup("\0"); process_title = strdup("\0");
return process_title; return process_title;
@ -252,6 +251,7 @@ int Platform::GetExecutablePath(char* buffer, size_t* size) {
} }
int Platform::GetCPUInfo(Local<Array> *cpus) { int Platform::GetCPUInfo(Local<Array> *cpus) {
HandleScope scope;
Local<Object> cpuinfo; Local<Object> cpuinfo;
Local<Object> cputimes; Local<Object> cputimes;
unsigned int ticks = (unsigned int)sysconf(_SC_CLK_TCK), unsigned int ticks = (unsigned int)sysconf(_SC_CLK_TCK),
@ -285,14 +285,17 @@ int Platform::GetCPUInfo(Local<Array> *cpus) {
if (fpStat) { if (fpStat) {
while (fgets(line, 511, fpStat) != NULL) { while (fgets(line, 511, fpStat) != NULL) {
if (strncmp(line, "cpu ", 4) == 0) if (strncmp(line, "cpu ", 4) == 0) {
continue; continue;
else if (strncmp(line, "intr ", 5) == 0) } else if (strncmp(line, "cpu", 3) != 0) {
break; break;
}
sscanf(line, "%*s %llu %llu %llu %llu", sscanf(line, "%*s %llu %llu %llu %llu",
&ticks_user, &ticks_nice, &ticks_sys, &ticks_idle); &ticks_user, &ticks_nice, &ticks_sys, &ticks_idle);
snprintf(speedPath, sizeof(speedPath), snprintf(speedPath, sizeof(speedPath),
"/sys/devices/system/cpu/cpu%u/cpufreq/cpuinfo_max_freq", i); "/sys/devices/system/cpu/cpu%u/cpufreq/cpuinfo_max_freq", i);
fpSpeed = fopen(speedPath, "r"); fpSpeed = fopen(speedPath, "r");
if (fpSpeed) { if (fpSpeed) {
if (fgets(line, 511, fpSpeed) != NULL) { if (fgets(line, 511, fpSpeed) != NULL) {
@ -355,4 +358,5 @@ int Platform::GetLoadAvg(Local<Array> *loads) {
return -1; return -1;
} }
} // namespace node } // namespace node

9
src/platform_linux.cc

@ -183,15 +183,19 @@ int Platform::GetCPUInfo(Local<Array> *cpus) {
if (fpStat) { if (fpStat) {
while (fgets(line, 511, fpStat) != NULL) { while (fgets(line, 511, fpStat) != NULL) {
if (strncmp(line, "cpu ", 4) == 0) if (strncmp(line, "cpu ", 4) == 0) {
continue; continue;
else if (strncmp(line, "intr ", 5) == 0) } else if (strncmp(line, "cpu", 3) != 0) {
break; break;
}
sscanf(line, "%*s %llu %llu %llu %llu %*llu %llu", sscanf(line, "%*s %llu %llu %llu %llu %*llu %llu",
&ticks_user, &ticks_nice, &ticks_sys, &ticks_idle, &ticks_intr); &ticks_user, &ticks_nice, &ticks_sys, &ticks_idle, &ticks_intr);
snprintf(speedPath, sizeof(speedPath), snprintf(speedPath, sizeof(speedPath),
"/sys/devices/system/cpu/cpu%u/cpufreq/cpuinfo_max_freq", i); "/sys/devices/system/cpu/cpu%u/cpufreq/cpuinfo_max_freq", i);
fpSpeed = fopen(speedPath, "r"); fpSpeed = fopen(speedPath, "r");
if (fpSpeed) { if (fpSpeed) {
if (fgets(line, 511, fpSpeed) != NULL) { if (fgets(line, 511, fpSpeed) != NULL) {
sscanf(line, "%u", &cpuspeed); sscanf(line, "%u", &cpuspeed);
@ -199,6 +203,7 @@ int Platform::GetCPUInfo(Local<Array> *cpus) {
} }
fclose(fpSpeed); fclose(fpSpeed);
} }
cpuinfo = Object::New(); cpuinfo = Object::New();
cputimes = Object::New(); cputimes = Object::New();
cputimes->Set(String::New("user"), Number::New(ticks_user * multiplier)); cputimes->Set(String::New("user"), Number::New(ticks_user * multiplier));

31
test/disabled/test-https-loop-to-google.js

@ -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
test/simple/test-fs-read-stream.js

@ -119,3 +119,8 @@ stream.on('data', function(chunk) {
stream.on('end', function() { stream.on('end', function() {
assert.equal('x', stream.data); assert.equal('x', stream.data);
}); });
// pause and then resume immediately.
var pauseRes = fs.createReadStream(rangeFile);
pauseRes.pause();
pauseRes.resume();

4
test/simple/test-tls-securepair-server.js

@ -52,8 +52,6 @@ var server = net.createServer(function(socket) {
socket.on('end', function() { socket.on('end', function() {
log('socket end'); log('socket end');
pair.cleartext.write('goodbye\r\n');
pair.cleartext.end();
}); });
pair.cleartext.on('error', function(err) { pair.cleartext.on('error', function(err) {
@ -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) { client.on('exit', function(code) {
opensslExitCode = code; opensslExitCode = code;

2
wscript

@ -824,7 +824,7 @@ def build(bld):
, 'CPPFLAGS' : " ".join(program.env["CPPFLAGS"]).replace('"', '\\"') , 'CPPFLAGS' : " ".join(program.env["CPPFLAGS"]).replace('"', '\\"')
, 'LIBFLAGS' : " ".join(program.env["LIBFLAGS"]).replace('"', '\\"') , 'LIBFLAGS' : " ".join(program.env["LIBFLAGS"]).replace('"', '\\"')
, 'PREFIX' : safe_path(program.env["PREFIX"]) , '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 return x

Loading…
Cancel
Save