Merge branch 'v0.4'
authorisaacs <i@izs.me>
Sun, 8 May 2011 03:38:32 +0000 (20:38 -0700)
committerisaacs <i@izs.me>
Sun, 8 May 2011 03:38:32 +0000 (20:38 -0700)
Conflicts:
lib/tls.js
lib/url.js
src/node_version.h
test/simple/test-buffer.js
test/simple/test-url.js

13 files changed:
1  2 
doc/api/http.markdown
lib/buffer.js
lib/http.js
lib/repl.js
lib/tls.js
src/node.cc
src/node.h
src/platform_sunos.cc
test/message/stack_overflow.out
test/message/throw_custom_error.out
test/message/throw_non_error.out
test/simple/test-buffer.js
wscript

Simple merge
diff --cc lib/buffer.js
Simple merge
diff --cc lib/http.js
Simple merge
diff --cc lib/repl.js
Simple merge
diff --cc lib/tls.js
@@@ -508,10 -474,6 +504,10 @@@ function SecurePair(credentials, isServ
                               this._requestCert,
                               this._rejectUnauthorized);
  
-     this._ssl.setNPNProtocols(NPNProtocols);
 +  if (NPN_ENABLED && NPNProtocols) {
++    this.ssl.setNPNProtocols(NPNProtocols);
 +    this.npnProtocol = null;
 +  }
  
    /* Acts as a r/w stream to the cleartext side of the stream. */
    this.cleartext = new CleartextStream(this);
@@@ -620,12 -577,8 +611,11 @@@ SecurePair.prototype.cycle = function(d
  };
  
  
- SecurePair.prototype._maybeInitFinished = function() {
-   if (this._ssl && !this._secureEstablished && this._ssl.isInitFinished()) {
+ SecurePair.prototype.maybeInitFinished = function() {
+   if (this.ssl && !this._secureEstablished && this.ssl.isInitFinished()) {
 +    if (NPN_ENABLED) {
-       this.npnProtocol = this._ssl.getNegotiatedProtocol();
++      this.npnProtocol = this.ssl.getNegotiatedProtocol();
 +    }
      this._secureEstablished = true;
      debug('secure established');
      this.emit('secure');
@@@ -904,10 -840,8 +887,10 @@@ exports.connect = function(port /* host
    socket.connect(port, host);
  
    pair.on('secure', function() {
-     var verifyError = pair._ssl.verifyError();
+     var verifyError = pair.ssl.verifyError();
  
 +    cleartext.npnProtocol = pair.npnProtocol;
 +
      if (verifyError) {
        cleartext.authorized = false;
        cleartext.authorizationError = verifyError;
diff --cc src/node.cc
Simple merge
diff --cc src/node.h
Simple merge
Simple merge
index 0000000,8269698..ccf101e
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,6 +1,6 @@@
 -node.js:134
+ before
++node.js:*
+         throw e; // process.nextTick error, or 'error' event on first tick
+         ^
+ RangeError: Maximum call stack size exceeded
index 0000000,5279758..9974e12
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,6 +1,6 @@@
 -node.js:134
+ before
++node.js:*
+         throw e; // process.nextTick error, or 'error' event on first tick
+         ^
+ MyCustomError: This is a custom message
index 0000000,7c22d2f..c24f813
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,6 +1,6 @@@
 -node.js:134
+ before
++node.js:*
+         throw e; // process.nextTick error, or 'error' event on first tick
+         ^
+ [object Object]
@@@ -540,20 -500,8 +540,25 @@@ console.log(z.length
  assert.equal(2, z.length);
  assert.equal(0x66, z[0]);
  assert.equal(0x6f, z[1]);
 +assert.equal(0, Buffer('hello').slice(0, 0).length)
 +
 +b = new Buffer(50);
 +b.fill("h");
 +for (var i = 0; i < b.length; i++) {
 +  assert.equal("h".charCodeAt(0), b[i]);
 +}
 +
 +b.fill(0);
 +for (var i = 0; i < b.length; i++) {
 +  assert.equal(0, b[i]);
 +}
 +
 +b.fill(1, 16, 32);
 +for (var i = 0; i < 16; i++) assert.equal(0, b[i]);
 +for (; i < 32; i++) assert.equal(1, b[i]);
 +for (; i < b.length; i++) assert.equal(0, b[i]);
+ var b = new SlowBuffer(10);
+ b.write('あいうえお', 'ucs2');
+ assert.equal(b.toString('ucs2'), 'あいうえお');
diff --cc wscript
Simple merge