From 2cde4983199473a1bf1650ef485f94b68194aa85 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 3 Jan 2012 17:14:58 -0800 Subject: [PATCH 01/20] Add another test to test-http-parser-bad-ref.js demoing #2438 --- test/simple/test-http-parser-bad-ref.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/simple/test-http-parser-bad-ref.js b/test/simple/test-http-parser-bad-ref.js index b8fd5b2917..c8c6806fd6 100644 --- a/test/simple/test-http-parser-bad-ref.js +++ b/test/simple/test-http-parser-bad-ref.js @@ -15,6 +15,8 @@ function flushPool() { } function demoBug(part1, part2) { + flushPool(); + var parser = new HTTPParser('REQUEST'); parser.headers = []; @@ -56,6 +58,8 @@ function demoBug(part1, part2) { parser.execute(b, 0, b.length); parser.finish(); })(); + + flushPool(); } @@ -64,9 +68,13 @@ demoBug('POST /1', '/22 HTTP/1.1\r\n' + 'Content-Length: 4\r\n\r\n' + 'pong'); +demoBug('POST /1/22 HTTP/1.1\r\n' + + 'Content-Type: tex', 't/plain\r\n' + + 'Content-Length: 4\r\n\r\n' + + 'pong'); process.on('exit', function() { - assert.equal(1, headersComplete); - assert.equal(1, messagesComplete); + assert.equal(2, headersComplete); + assert.equal(2, messagesComplete); console.log("done!"); }); From f3da6c6c045fb9d629509cea53e3631342f785d3 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 29 Dec 2011 16:06:14 -0800 Subject: [PATCH 02/20] Potential fix for #2438 - Save StringPtr if the header hasn't been completely received yet after one packet. - Add one to num_fields and num_values. They were actually one less than the number of fields and values. - Remove always_inline makes debugging difficult, and has negligible performance benefits. --- src/node_http_parser.cc | 78 ++++++++++++++++++++------------- test/simple/test-http-parser.js | 6 ++- 2 files changed, 51 insertions(+), 33 deletions(-) diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc index 38251a1e7c..8d9000d9d7 100644 --- a/src/node_http_parser.cc +++ b/src/node_http_parser.cc @@ -103,27 +103,12 @@ static char* current_buffer_data; static size_t current_buffer_len; -// gcc 3.x knows the always_inline attribute but fails at build time with a -// "sorry, unimplemented: inlining failed" error when compiling at -O0 -#if defined(__GNUC__) -# if __GNUC__ >= 4 -# define always_inline __attribute__((always_inline)) -# else -# define always_inline inline -# endif -#elif defined(_MSC_VER) -# define always_inline __forceinline -#else -# define always_inline -#endif - - #define HTTP_CB(name) \ static int name(http_parser* p_) { \ Parser* self = container_of(p_, Parser, parser_); \ return self->name##_(); \ } \ - int always_inline name##_() + int name##_() #define HTTP_DATA_CB(name) \ @@ -131,7 +116,7 @@ static size_t current_buffer_len; Parser* self = container_of(p_, Parser, parser_); \ return self->name##_(at, length); \ } \ - int always_inline name##_(const char* at, size_t length) + int name##_(const char* at, size_t length) static inline Persistent @@ -179,6 +164,19 @@ struct StringPtr { } + // If str_ does not point to a heap string yet, this function makes it do + // so. This is called at the end of each http_parser_execute() so as not + // to leak references. See issue #2438 and test-http-parser-bad-ref.js. + void Save() { + if (!on_heap_ && size_ > 0) { + char* s = new char[size_]; + memcpy(s, str_, size_); + str_ = s; + on_heap_ = true; + } + } + + void Reset() { if (on_heap_) { delete[] str_; @@ -237,7 +235,7 @@ public: HTTP_CB(on_message_begin) { - num_fields_ = num_values_ = -1; + num_fields_ = num_values_ = 0; url_.Reset(); return 0; } @@ -252,18 +250,20 @@ public: HTTP_DATA_CB(on_header_field) { if (num_fields_ == num_values_) { // start of new field name - if (++num_fields_ == ARRAY_SIZE(fields_)) { + num_fields_++; + if (num_fields_ == ARRAY_SIZE(fields_)) { + // ran out of space - flush to javascript land Flush(); - num_fields_ = 0; - num_values_ = -1; + num_fields_ = 1; + num_values_ = 0; } - fields_[num_fields_].Reset(); + fields_[num_fields_ - 1].Reset(); } assert(num_fields_ < (int)ARRAY_SIZE(fields_)); assert(num_fields_ == num_values_ + 1); - fields_[num_fields_].Update(at, length); + fields_[num_fields_ - 1].Update(at, length); return 0; } @@ -272,13 +272,14 @@ public: HTTP_DATA_CB(on_header_value) { if (num_values_ != num_fields_) { // start of new header value - values_[++num_values_].Reset(); + num_values_++; + values_[num_values_ - 1].Reset(); } assert(num_values_ < (int)ARRAY_SIZE(values_)); assert(num_values_ == num_fields_); - values_[num_values_].Update(at, length); + values_[num_values_ - 1].Update(at, length); return 0; } @@ -302,7 +303,7 @@ public: if (parser_.type == HTTP_REQUEST) message_info->Set(url_sym, url_.ToString()); } - num_fields_ = num_values_ = -1; + num_fields_ = num_values_ = 0; // METHOD if (parser_.type == HTTP_REQUEST) { @@ -364,7 +365,7 @@ public: HTTP_CB(on_message_complete) { HandleScope scope; - if (num_fields_ != -1) + if (num_fields_) Flush(); // Flush trailing HTTP headers. Local cb = handle_->Get(on_message_complete_sym); @@ -401,6 +402,19 @@ public: } + void Save() { + url_.Save(); + + for (int i = 0; i < num_fields_; i++) { + fields_[i].Save(); + } + + for (int i = 0; i < num_values_; i++) { + values_[i].Save(); + } + } + + // var bytesParsed = parser->execute(buffer, off, len); static Handle Execute(const Arguments& args) { HandleScope scope; @@ -447,6 +461,8 @@ public: size_t nparsed = http_parser_execute(&parser->parser_, &settings, buffer_data + off, len); + parser->Save(); + // Unassign the 'buffer_' variable assert(current_buffer); current_buffer = NULL; @@ -515,9 +531,9 @@ private: Local CreateHeaders() { // num_values_ is either -1 or the entry # of the last header // so num_values_ == 0 means there's a single header - Local headers = Array::New(2 * (num_values_ + 1)); + Local headers = Array::New(2 * num_values_); - for (int i = 0; i < num_values_ + 1; ++i) { + for (int i = 0; i < num_values_; ++i) { headers->Set(2 * i, fields_[i].ToString()); headers->Set(2 * i + 1, values_[i].ToString()); } @@ -553,8 +569,8 @@ private: void Init(enum http_parser_type type) { http_parser_init(&parser_, type); url_.Reset(); - num_fields_ = -1; - num_values_ = -1; + num_fields_ = 0; + num_values_ = 0; have_flushed_ = false; got_exception_ = false; } diff --git a/test/simple/test-http-parser.js b/test/simple/test-http-parser.js index 086d53bf44..7dc15043c4 100644 --- a/test/simple/test-http-parser.js +++ b/test/simple/test-http-parser.js @@ -381,7 +381,7 @@ function expectBody(expected) { // (function() { var request = Buffer( - 'POST /it HTTP/1.1' + CRLF + + 'POST /helpme HTTP/1.1' + CRLF + 'Content-Type: text/plain' + CRLF + 'Transfer-Encoding: chunked' + CRLF + CRLF + @@ -403,7 +403,7 @@ function expectBody(expected) { parser.onHeadersComplete = mustCall(function(info) { assert.equal(info.method, 'POST'); - assert.equal(info.url || parser.url, '/it'); + assert.equal(info.url || parser.url, '/helpme'); assert.equal(info.versionMajor, 1); assert.equal(info.versionMinor, 1); }); @@ -424,7 +424,9 @@ function expectBody(expected) { for (var i = 1; i < request.length - 1; ++i) { var a = request.slice(0, i); + console.error("request.slice(0, " + i + ") = ", JSON.stringify(a.toString())); var b = request.slice(i); + console.error("request.slice(" + i + ") = ", JSON.stringify(b.toString())); test(a, b); } })(); From 3452477dcb652cc539eb878b103808113d31ac49 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Wed, 4 Jan 2012 11:20:50 -0800 Subject: [PATCH 03/20] Update address in CLA --- doc/cla.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/cla.html b/doc/cla.html index a117595a38..ed5660b7bb 100644 --- a/doc/cla.html +++ b/doc/cla.html @@ -58,18 +58,18 @@ Contributions and send us an original signed Agreement at

Joyent, Inc
-345 California Street, Suite 2000
-San Francisco, CA 94104
+One Embarcadero Center, 9th Floor
+San Francisco, CA 94111
U.S.A.

Scanned agreements may also be emailed in PDF format to -ryan@joyent.com. You should also keep a copy for your own +emily@joyent.com. You should also keep a copy for your own records.

If you have questions about these terms, please contact us -at ryan@joyent.com. +at emily@joyent.com.


From baebd30eeec84d73617183be4b5be92557518d6c Mon Sep 17 00:00:00 2001
From: koichik 
Date: Thu, 5 Jan 2012 17:43:00 +0900
Subject: [PATCH 04/20] http: use `self` insted of `this`

---
 lib/http.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/http.js b/lib/http.js
index 25c308379e..89005b3869 100644
--- a/lib/http.js
+++ b/lib/http.js
@@ -903,7 +903,7 @@ function Agent(options) {
       self.requests[name].shift().onSocket(socket);
       if (self.requests[name].length === 0) {
         // don't leak
-        delete this.requests[name];
+        delete self.requests[name];
       }
     } else {
       // If there are no pending requests just destroy the

From 760928bfad44119d8790311f63f8fcf64b59f836 Mon Sep 17 00:00:00 2001
From: Ben Noordhuis 
Date: Thu, 5 Jan 2012 16:44:11 +0100
Subject: [PATCH 05/20] docs: mention that python 2.6 or 2.7 is required

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index c167589578..39e83321e5 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@ Evented I/O for V8 javascript. [![Build Status](https://secure.travis-ci.org/joy
 
 ### To build:
 
-Unix/Macintosh (requires python >= 2.5.2):
+Unix/Macintosh (requires python 2.6 or 2.7):
 
     ./configure
     make

From 78dbb4b5b1bd45824f9345e0435d0071263db176 Mon Sep 17 00:00:00 2001
From: isaacs 
Date: Wed, 4 Jan 2012 15:09:13 -0800
Subject: [PATCH 06/20] npm@1.1.0-beta-10

---
 deps/npm/Makefile                             |  17 ++-
 deps/npm/doc/cli/disputes.md                  |  84 ++++++++++++
 deps/npm/doc/cli/faq.md                       |  66 +++++++---
 deps/npm/doc/cli/index.md                     |   4 +
 deps/npm/doc/cli/owner.md                     |   1 +
 deps/npm/doc/cli/registry.md                  |   1 +
 deps/npm/html/api/bin.html                    |   2 +-
 deps/npm/html/api/bugs.html                   |   2 +-
 deps/npm/html/api/commands.html               |   2 +-
 deps/npm/html/api/config.html                 |   2 +-
 deps/npm/html/api/deprecate.html              |   2 +-
 deps/npm/html/api/docs.html                   |   2 +-
 deps/npm/html/api/edit.html                   |   2 +-
 deps/npm/html/api/explore.html                |   2 +-
 deps/npm/html/api/help-search.html            |   2 +-
 deps/npm/html/api/init.html                   |   2 +-
 deps/npm/html/api/install.html                |   2 +-
 deps/npm/html/api/link.html                   |   2 +-
 deps/npm/html/api/load.html                   |   2 +-
 deps/npm/html/api/ls.html                     |   2 +-
 deps/npm/html/api/npm.html                    |   4 +-
 deps/npm/html/api/outdated.html               |   2 +-
 deps/npm/html/api/owner.html                  |   2 +-
 deps/npm/html/api/pack.html                   |   2 +-
 deps/npm/html/api/prefix.html                 |   2 +-
 deps/npm/html/api/prune.html                  |   2 +-
 deps/npm/html/api/publish.html                |   2 +-
 deps/npm/html/api/rebuild.html                |   2 +-
 deps/npm/html/api/restart.html                |   2 +-
 deps/npm/html/api/root.html                   |   2 +-
 deps/npm/html/api/run-script.html             |   2 +-
 deps/npm/html/api/search.html                 |   2 +-
 deps/npm/html/api/start.html                  |   2 +-
 deps/npm/html/api/stop.html                   |   2 +-
 deps/npm/html/api/submodule.html              |   2 +-
 deps/npm/html/api/tag.html                    |   2 +-
 deps/npm/html/api/test.html                   |   2 +-
 deps/npm/html/api/uninstall.html              |   2 +-
 deps/npm/html/api/unpublish.html              |   2 +-
 deps/npm/html/api/update.html                 |   2 +-
 deps/npm/html/api/version.html                |   2 +-
 deps/npm/html/api/view.html                   |   2 +-
 deps/npm/html/api/whoami.html                 |   2 +-
 deps/npm/html/doc/README.html                 |   2 +-
 deps/npm/html/doc/adduser.html                |   2 +-
 deps/npm/html/doc/bin.html                    |   2 +-
 deps/npm/html/doc/bugs.html                   |   2 +-
 deps/npm/html/doc/build.html                  |   2 +-
 deps/npm/html/doc/bundle.html                 |   2 +-
 deps/npm/html/doc/cache.html                  |   2 +-
 deps/npm/html/doc/changelog.html              |   2 +-
 deps/npm/html/doc/coding-style.html           |   2 +-
 deps/npm/html/doc/completion.html             |   2 +-
 deps/npm/html/doc/config.html                 |   2 +-
 deps/npm/html/doc/deprecate.html              |   2 +-
 deps/npm/html/doc/developers.html             |   2 +-
 deps/npm/html/doc/disputes.html               | 115 ++++++++++++++++
 deps/npm/html/doc/docs.html                   |   2 +-
 deps/npm/html/doc/edit.html                   |   2 +-
 deps/npm/html/doc/explore.html                |   2 +-
 deps/npm/html/doc/faq.html                    |  68 +++++++---
 deps/npm/html/doc/folders.html                |   2 +-
 deps/npm/html/doc/help-search.html            |   2 +-
 deps/npm/html/doc/help.html                   |   2 +-
 deps/npm/html/doc/index.html                  |   6 +-
 deps/npm/html/doc/init.html                   |   2 +-
 deps/npm/html/doc/install.html                |   2 +-
 deps/npm/html/doc/json.html                   |   2 +-
 deps/npm/html/doc/link.html                   |   2 +-
 deps/npm/html/doc/list.html                   |   2 +-
 deps/npm/html/doc/npm.html                    |   4 +-
 deps/npm/html/doc/outdated.html               |   2 +-
 deps/npm/html/doc/owner.html                  |   4 +-
 deps/npm/html/doc/pack.html                   |   2 +-
 deps/npm/html/doc/prefix.html                 |   2 +-
 deps/npm/html/doc/prune.html                  |   2 +-
 deps/npm/html/doc/publish.html                |   2 +-
 deps/npm/html/doc/rebuild.html                |   2 +-
 deps/npm/html/doc/registry.html               |   4 +-
 deps/npm/html/doc/removing-npm.html           |   2 +-
 deps/npm/html/doc/restart.html                |   2 +-
 deps/npm/html/doc/root.html                   |   2 +-
 deps/npm/html/doc/run-script.html             |   2 +-
 deps/npm/html/doc/scripts.html                |   2 +-
 deps/npm/html/doc/search.html                 |   2 +-
 deps/npm/html/doc/semver.html                 |   2 +-
 deps/npm/html/doc/star.html                   |   2 +-
 deps/npm/html/doc/start.html                  |   2 +-
 deps/npm/html/doc/stop.html                   |   2 +-
 deps/npm/html/doc/submodule.html              |   2 +-
 deps/npm/html/doc/tag.html                    |   2 +-
 deps/npm/html/doc/test.html                   |   2 +-
 deps/npm/html/doc/uninstall.html              |   2 +-
 deps/npm/html/doc/unpublish.html              |   2 +-
 deps/npm/html/doc/update.html                 |   2 +-
 deps/npm/html/doc/version.html                |   2 +-
 deps/npm/html/doc/view.html                   |   2 +-
 deps/npm/html/doc/whoami.html                 |   2 +-
 deps/npm/lib/npm.js                           |  51 ++++---
 deps/npm/lib/utils/cmd-shim.js                |   2 +-
 deps/npm/lib/utils/fetch.js                   |   2 +-
 deps/npm/lib/utils/ini.js                     |  33 +----
 deps/npm/lib/utils/npm-registry-client/get.js |   4 +-
 deps/npm/lib/utils/read-json.js               |  17 ++-
 deps/npm/man/man1/README.1                    |   2 +-
 deps/npm/man/man1/adduser.1                   |   2 +-
 deps/npm/man/man1/bin.1                       |   2 +-
 deps/npm/man/man1/bugs.1                      |   2 +-
 deps/npm/man/man1/build.1                     |   2 +-
 deps/npm/man/man1/bundle.1                    |   2 +-
 deps/npm/man/man1/cache.1                     |   2 +-
 deps/npm/man/man1/changelog.1                 |   2 +-
 deps/npm/man/man1/coding-style.1              |   2 +-
 deps/npm/man/man1/completion.1                |   2 +-
 deps/npm/man/man1/config.1                    |   2 +-
 deps/npm/man/man1/deprecate.1                 |   2 +-
 deps/npm/man/man1/developers.1                |   2 +-
 deps/npm/man/man1/disputes.1                  | 124 ++++++++++++++++++
 deps/npm/man/man1/docs.1                      |   2 +-
 deps/npm/man/man1/edit.1                      |   2 +-
 deps/npm/man/man1/explore.1                   |   2 +-
 deps/npm/man/man1/faq.1                       |  77 +++++++----
 deps/npm/man/man1/folders.1                   |   2 +-
 deps/npm/man/man1/help-search.1               |   2 +-
 deps/npm/man/man1/help.1                      |   2 +-
 deps/npm/man/man1/index.1                     |   5 +-
 deps/npm/man/man1/init.1                      |   2 +-
 deps/npm/man/man1/install.1                   |   2 +-
 deps/npm/man/man1/json.1                      |   2 +-
 deps/npm/man/man1/link.1                      |   2 +-
 deps/npm/man/man1/list.1                      |   2 +-
 deps/npm/man/man1/npm.1                       |   4 +-
 deps/npm/man/man1/outdated.1                  |   2 +-
 deps/npm/man/man1/owner.1                     |   5 +-
 deps/npm/man/man1/pack.1                      |   2 +-
 deps/npm/man/man1/prefix.1                    |   2 +-
 deps/npm/man/man1/prune.1                     |   2 +-
 deps/npm/man/man1/publish.1                   |   2 +-
 deps/npm/man/man1/rebuild.1                   |   2 +-
 deps/npm/man/man1/registry.1                  |   5 +-
 deps/npm/man/man1/removing-npm.1              |   2 +-
 deps/npm/man/man1/restart.1                   |   2 +-
 deps/npm/man/man1/root.1                      |   2 +-
 deps/npm/man/man1/run-script.1                |   2 +-
 deps/npm/man/man1/scripts.1                   |   2 +-
 deps/npm/man/man1/search.1                    |   2 +-
 deps/npm/man/man1/semver.1                    |   2 +-
 deps/npm/man/man1/star.1                      |   2 +-
 deps/npm/man/man1/start.1                     |   2 +-
 deps/npm/man/man1/stop.1                      |   2 +-
 deps/npm/man/man1/submodule.1                 |   2 +-
 deps/npm/man/man1/tag.1                       |   2 +-
 deps/npm/man/man1/test.1                      |   2 +-
 deps/npm/man/man1/uninstall.1                 |   2 +-
 deps/npm/man/man1/unpublish.1                 |   2 +-
 deps/npm/man/man1/update.1                    |   2 +-
 deps/npm/man/man1/version.1                   |   2 +-
 deps/npm/man/man1/view.1                      |   2 +-
 deps/npm/man/man1/whoami.1                    |   2 +-
 deps/npm/man/man3/bin.3                       |   2 +-
 deps/npm/man/man3/bugs.3                      |   2 +-
 deps/npm/man/man3/commands.3                  |   2 +-
 deps/npm/man/man3/config.3                    |   2 +-
 deps/npm/man/man3/deprecate.3                 |   2 +-
 deps/npm/man/man3/docs.3                      |   2 +-
 deps/npm/man/man3/edit.3                      |   2 +-
 deps/npm/man/man3/explore.3                   |   2 +-
 deps/npm/man/man3/help-search.3               |   2 +-
 deps/npm/man/man3/init.3                      |   2 +-
 deps/npm/man/man3/install.3                   |   2 +-
 deps/npm/man/man3/link.3                      |   2 +-
 deps/npm/man/man3/load.3                      |   2 +-
 deps/npm/man/man3/ls.3                        |   2 +-
 deps/npm/man/man3/npm.3                       |   4 +-
 deps/npm/man/man3/outdated.3                  |   2 +-
 deps/npm/man/man3/owner.3                     |   2 +-
 deps/npm/man/man3/pack.3                      |   2 +-
 deps/npm/man/man3/prefix.3                    |   2 +-
 deps/npm/man/man3/prune.3                     |   2 +-
 deps/npm/man/man3/publish.3                   |   2 +-
 deps/npm/man/man3/rebuild.3                   |   2 +-
 deps/npm/man/man3/restart.3                   |   2 +-
 deps/npm/man/man3/root.3                      |   2 +-
 deps/npm/man/man3/run-script.3                |   2 +-
 deps/npm/man/man3/search.3                    |   2 +-
 deps/npm/man/man3/start.3                     |   2 +-
 deps/npm/man/man3/stop.3                      |   2 +-
 deps/npm/man/man3/submodule.3                 |   2 +-
 deps/npm/man/man3/tag.3                       |   2 +-
 deps/npm/man/man3/test.3                      |   2 +-
 deps/npm/man/man3/uninstall.3                 |   2 +-
 deps/npm/man/man3/unpublish.3                 |   2 +-
 deps/npm/man/man3/update.3                    |   2 +-
 deps/npm/man/man3/version.3                   |   2 +-
 deps/npm/man/man3/view.3                      |   2 +-
 deps/npm/man/man3/whoami.3                    |   2 +-
 .../node_modules/fstream/lib/link-writer.js   |   1 +
 deps/npm/node_modules/fstream/package.json    |   2 +-
 deps/npm/node_modules/tar/lib/pack.js         |   4 +-
 deps/npm/node_modules/tar/package.json        |   2 +-
 deps/npm/package.json                         |   2 +-
 deps/npm/scripts/install.sh                   |  52 ++++++--
 deps/npm/scripts/release.sh                   |  40 ++++++
 deps/npm/test/run.js                          |   7 +-
 204 files changed, 835 insertions(+), 326 deletions(-)
 create mode 100644 deps/npm/doc/cli/disputes.md
 create mode 100644 deps/npm/html/doc/disputes.html
 create mode 100644 deps/npm/man/man1/disputes.1
 create mode 100644 deps/npm/scripts/release.sh

diff --git a/deps/npm/Makefile b/deps/npm/Makefile
index 20686da009..7d3e106535 100644
--- a/deps/npm/Makefile
+++ b/deps/npm/Makefile
@@ -108,18 +108,29 @@ version: link
 	git add package.json &&\
 	git ci -m v$(shell npm -v)
 
-publish: link
+publish: link doc
+	git tag -d v$(shell npm -v) || true
+	git push origin :v$(shell npm -v) || true
+	npm unpublish npm@$(shell npm -v) || true
 	git tag -s -m v$(shell npm -v) v$(shell npm -v) &&\
 	git push origin --tags &&\
 	npm publish &&\
-	make doc-publish
+	npm tag npm@$(shell npm -v) $(shell npm -v | awk -F. '{print $$1 "." $$2}') &&\
+	make doc-publish &&\
+	make zip-publish
 
 docpublish: doc-publish
 doc-publish: doc
 	rsync -vazu --stats --no-implied-dirs --delete html/doc/ npmjs.org:/var/www/npmjs.org/public/doc
 	rsync -vazu --stats --no-implied-dirs --delete html/api/ npmjs.org:/var/www/npmjs.org/public/api
 
+zip-publish: release
+	scp release/*.zip npmjs.org:/var/www/npmjs.org/public/dist/
+
+release:
+	@bash scripts/release.sh
+
 sandwich:
 	@[ $$(whoami) = "root" ] && (echo "ok"; echo "ham" > sandwich) || echo "make it yourself"
 
-.PHONY: all latest install dev link doc clean uninstall test man doc-publish doc-clean docclean docpublish
+.PHONY: all latest install dev link doc clean uninstall test man doc-publish doc-clean docclean docpublish release zip-publish
diff --git a/deps/npm/doc/cli/disputes.md b/deps/npm/doc/cli/disputes.md
new file mode 100644
index 0000000000..96ad9ef1f8
--- /dev/null
+++ b/deps/npm/doc/cli/disputes.md
@@ -0,0 +1,84 @@
+npm-disputes(1) -- Handling Module Name Disputes
+================================================
+
+## SYNOPSIS
+
+1. Get the author email with `npm owner ls `
+1. Email the author, CC .
+2. After a few weeks, if there's no resolution, we'll sort it out.
+
+## DESCRIPTION
+
+There sometimes arise cases where a user publishes a module, and then
+later, some other user wants to use that name.  Here are some common
+ways that happens (each of these is based on actual events.)
+
+1. Bob writes a JavaScript module `foo`, which is not node-specific.
+   Bob doesn't use node at all.  Joe wants to use `foo` in node, so he
+   wraps it in an npm module.  Some time later, Bob starts using node,
+   and wants to take over management of his program.
+2. Bob writes an npm module `foo`, and publishes it.  Perhaps much
+   later, Joe finds a bug in `foo`, and fixes it.  He sends a pull
+   request to Bob, but Bob doesn't have the time to deal with it,
+   because he has a new job and a new baby and is focused on his new
+   erlang project, and kind of not involved with node any more.  Joe
+   would like to publish a new `foo`, but can't, because the name is
+   taken.
+3. Bob writes a 10-line flow-control library, and calls it `foo`, and
+   publishes it to the npm registry.  Being a simple little thing, it
+   never really has to be updated.  Joe works for Foo Inc, the makers
+   of the critically acclaimed and widely-marketed `foo` JavaScript
+   toolkit framework.  They publish it to npm as `foojs`, but people are
+   routinely confused when `npm install foo` is some different thing.
+4. Bob writes a parser for the widely-known `foo` file format, because
+   he needs it for work.  Then, he gets a new job, and never updates the
+   prototype.  Later on, Joe writes a much more complete `foo` parser,
+   but can't publish, because Bob's `foo` is in the way.
+
+The validity of Joe's claim in each situation can be debated.  However,
+Joe's appropriate course of action in each case is the same.
+
+1. `npm owner ls foo`.  This will tell Joe the email address of the
+   owner (Bob).
+2. Joe emails Bob, explaining the situation **as respecfully as possible**,
+   and what he would like to do with the module name.  He adds
+   isaacs  to the CC list of the email.  Mention in the email
+   that Bob can run `npm owner add joe foo` to add Joe as an owner of
+   the `foo` package.
+3. After a reasonable amount of time, if Bob has not responded, or if
+   Bob and Joe can't come to any sort of resolution, email isaacs
+    and we'll sort it out.
+
+## REASONING
+
+In almost every case so far, the parties involved have been able to reach
+an amicable resolution without any major intervention.  Most people
+really do want to be reasonable, and are probably not even aware that
+they're in your way.
+
+Module ecosystems are most vibrant and powerful when they are as
+self-directed as possible.  If an admin one day deletes something you
+had worked on, then that is going to make most people quite upset,
+regardless of the justification.  When humans solve their problems by
+talking to other humans with respect, everyone has the chance to end up
+feeling good about the interaction.
+
+## EXCEPTIONS
+
+Some things are not allowed, and will be removed without discussion if
+they are brought to the attention of the npm registry admins, including
+but not limited to:
+
+1. Malware (that is, a module designed to exploit or harm the machine on
+   which it is installed)
+2. Violations of copyright or licenses (for example, cloning an
+   MIT-licensed program, and then removing or changing the copyright and
+   license statement)
+3. Illegal content.
+
+If you see bad behavior like this, please report it right away.
+
+## SEE ALSO
+
+* npm-registry(1)
+* npm-owner(1)
diff --git a/deps/npm/doc/cli/faq.md b/deps/npm/doc/cli/faq.md
index 15bb0c637d..938338c22b 100644
--- a/deps/npm/doc/cli/faq.md
+++ b/deps/npm/doc/cli/faq.md
@@ -32,35 +32,65 @@ tl;dr:
   something with the `-g` flag, then its executables go in `npm bin -g`
   and its modules go in `npm root -g`.
 
-## How do I install something everywhere?
+## How do I install something on my computer in a central location?
 
-Install it globally by tacking `-g` or `--global` to the command.
+Install it globally by tacking `-g` or `--global` to the command.  (This
+is especially important for command line utilities that need to add
+their bins to the global system `PATH`.)
 
 ## I installed something globally, but I can't `require()` it
 
 Install it locally.
 
-## I don't wanna.
+The global install location is a place for command-line utilities
+to put their bins in the system `PATH`.  It's not for use with `require()`.
 
-Check out `npm link`.  You might like it.
+If you `require()` a module in your code, then that means it's a
+dependency, and a part of your program.  You need to install it locally
+in your program.
 
-## No, I really want 0.x style 'everything global' style.
+## Why can't npm just put everything in one place, like other package managers?
 
-Ok, fine.  Do this:
+Not every change is an improvement, but every improvement is a change.
+This would be like asking git to do network IO for every commit.  It's
+not going to happen, because it's a terrible idea that causes more
+problems than it solves.
 
-    echo 'export NODE_PATH="'$(npm root -g)'"' >> ~/.bashrc
-    . ~/.bashrc
-    npm config set global true
+It is much harder to avoid dependency conflicts without nesting
+dependencies.  This is fundamental to the way that npm works, and has
+proven to be an extremely successful approach.  See `npm-folders(1)` for
+more details.
 
-This is not recommended.
+If you want a package to be installed in one place, and have all your
+programs reference the same copy of it, then use the `npm link` command.
+That's what it's for.  Install it globally, then link it into each
+program that uses it.
 
-Many things **will not work** if you do this.  Make sure you read and
-understand `npm-config(1)` and `npm-global(1)` before you complain
-about things being broken.
+## Whatever, I really want the old style 'everything global' style.
 
-When you realize what a mistake it was, do this to switch back:
+Write your own package manager, then.  It's not that hard.
 
-    npm config delete global --local
+npm will not help you do something that is known to be a bad idea.
+
+## Should I check my `node_modules` folder into git?
+
+Mikeal Rogers answered this question very well:
+
+
+
+tl;dr
+
+* Check `node_modules` into git for things you **deploy**, such as
+  websites and apps.
+* Do not check `node_modules` into git for libraries and modules
+  intended to be reused.
+* Use npm to manage dependencies in your dev environment, but not in
+  your deployment scripts.
+
+## Is it 'npm' or 'NPM' or 'Npm'?
+
+npm should never be capitalized unless it is being displayed in a
+location that is customarily all-caps (such as the title of man pages.)
 
 ## If 'npm' is an acronym, why is it never capitalized?
 
@@ -73,7 +103,7 @@ acronym, and thus incorrectly named.)
 National Association of Pastoral Musicians.  You can learn more
 about them at .
 
-In software, "NPM" is a non-parametric mapping utility written by
+In software, "NPM" is a Non-Parametric Mapping utility written by
 Chris Rorden.  You can analyze pictures of brains with it.  Learn more
 about the (capitalized) NPM program at .
 
@@ -186,11 +216,9 @@ Go to .
 ## I get ECONNREFUSED a lot.  What's up?
 
 Either the registry is down, or node's DNS isn't able to reach out.
-This happens a lot if you don't follow *all* the steps in the Cygwin
-setup doc.
 
 To check if the registry is down, open up
-
+
 in a web browser.  This will also tell you if you are just unable to
 access the internet for some reason.
 
diff --git a/deps/npm/doc/cli/index.md b/deps/npm/doc/cli/index.md
index b355042df0..5a9b99be19 100644
--- a/deps/npm/doc/cli/index.md
+++ b/deps/npm/doc/cli/index.md
@@ -54,6 +54,10 @@ npm-index(1) -- Index of all npm documentation
 
  Developer Guide
 
+## npm-disputes(1)
+
+ Handling Module Name Disputes
+
 ## npm-docs(1)
 
  Docs for a package in a web browser maybe
diff --git a/deps/npm/doc/cli/owner.md b/deps/npm/doc/cli/owner.md
index 8365da379e..902e083fca 100644
--- a/deps/npm/doc/cli/owner.md
+++ b/deps/npm/doc/cli/owner.md
@@ -30,3 +30,4 @@ that is not implemented at this time.
 * npm-publish(1)
 * npm-registry(1)
 * npm-adduser(1)
+* npm-disputes(1)
diff --git a/deps/npm/doc/cli/registry.md b/deps/npm/doc/cli/registry.md
index 13c872494c..44ddd94e05 100644
--- a/deps/npm/doc/cli/registry.md
+++ b/deps/npm/doc/cli/registry.md
@@ -90,3 +90,4 @@ Stay tuned!
 
 * npm-config(1)
 * npm-developers(1)
+* npm-disputes(1)
diff --git a/deps/npm/html/api/bin.html b/deps/npm/html/api/bin.html
index b54352f0b0..a5bd3325c4 100644
--- a/deps/npm/html/api/bin.html
+++ b/deps/npm/html/api/bin.html
@@ -19,7 +19,7 @@
 

This function should not be used programmatically. Instead, just refer to the npm.bin member.

- + + diff --git a/deps/npm/html/doc/docs.html b/deps/npm/html/doc/docs.html index 212fabb996..7c0d94d7da 100644 --- a/deps/npm/html/doc/docs.html +++ b/deps/npm/html/doc/docs.html @@ -37,7 +37,7 @@ config param.

- +