Compare commits

..

113 Commits

Author SHA1 Message Date
Alexis Campailla
06990da3f6 test: debug-signal-cluster increase timeouts
The test needs a little more time to run so that it passes for all
builds (eg: Windows, debug)
2014-01-13 17:51:17 -08:00
Alexis Campailla
4946c833f3 debug client: connect after child is ready
We now wait to connect to the debuggee until we know that
its error stream has data, to ensure that the output message
"connecting..... ok" appears after "Debugger listening on port xyz"

I also increased the test timeout to let the more complex
tests finish in time on Windows

This change fixes the following unit tests on Windows:
 test-debugger-repl.js
 test-debugger-repl-term.js
 test-debugger-repl-utf8.js
 test-debugger-repl-restart.js
2014-01-13 17:42:27 -08:00
Timothy J Fontaine
dcd5224e1f test: move debugger repl into own section 2014-01-13 17:35:41 -08:00
Timothy J Fontaine
be3aaeb0e9 test: refactor to use common testcfg 2014-01-13 17:09:12 -08:00
Alexis Campailla
2e3da9be84 test: terminate gracefully in cluster-net-send
Killing the worker without ensuring the socket was closed
was causing intermittent ECONNRESET errors.
2014-01-13 15:15:10 -08:00
Timothy J Fontaine
fc52ed85f6 Merge remote-tracking branch 'upstream/v0.10' 2014-01-13 14:56:41 -08:00
Timothy J Fontaine
429b58701a Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	deps/uv/ChangeLog
	deps/uv/build.mk
	deps/uv/src/version.c
	deps/uv/test/test-ipc.c
	deps/v8/src/objects.cc
	src/node.cc
	src/node_os.cc
2014-01-13 14:56:12 -08:00
Sam Roberts
7bd6e33318 doc: streams must be open to be passed to child
spawn stdio options can be a 'stream', but the following code
fails with "Incorrect value for stdio stream: [object Object]",
despite being a stream. The problem is the test isn't really
for a stream, its for an object with a numeric `.fd` property,
and streams do not have an fd until their async 'open' event
has occurred. This is reasonable, but was not documented.

    child_process.spawn('date', [], {stdio: [
      'ignore',
      fs.createWriteStream('out.txt',{flags:'a'}),
      'ignore']})
2014-01-13 21:36:56 +00:00
Alexis Campailla
1b74892807 test: close debug client in test-debugger-client
Killing the debuggee without first closing the socket can result
in an ECONNRESET error.
2014-01-13 13:16:25 -08:00
Alex Kocharin
ec57ecc982 http: concatenate duplicate headers by default 2014-01-13 17:29:58 +00:00
Timothy J Fontaine
8753bb3859 src: return empty set on ENOSYS for interfaces
If node was compiled with --no-ifaddrs to support older operating
systems, don't throw instead simply return an empty object

Fixes #6846
2014-01-12 10:04:21 -08:00
svenpanne@chromium.org
196184d332 v8: backport codereview.chromium.org/11362182
Keep the number of descriptors below
DescriptorArray::kMaxNumberOfDescriptors even for accessors

Review URL: https://codereview.chromium.org/11362182
2014-01-10 23:32:08 +00:00
Tom Gallacher
38a07a929b util: handle escaped forward slashes correctly
Fixes #6835
2014-01-10 21:13:46 +00:00
gluxon
56913d2cde doc: Fix argument typo in SimpleProtocol example 2014-01-10 08:42:34 -08:00
Ryan Graham
5106cadffb domain: fix off-by-one in Domain.exit()
We want to clear the found domain and the domains after it.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-01-09 15:25:58 -08:00
Trevor Norris
2eddd74112 http: use writev on chunked encoding
Now will process all write() that were done on a single tick in a single
writev().
2014-01-09 15:07:14 -08:00
Jeff Barczewski
82c2084b4e test: check RR scheduler has necessary methods
The RR cluster scheduler replaces the normal StreamWrap handle. Because
of this the AsyncListener method failed to be in place when domains were
in use.

The issue was resolved in 828f145 by reverting having domains use
AsyncListeners.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-01-09 14:17:13 -08:00
Timothy J Fontaine
270c2deb84 src: OnFatalError handler must abort()
We are in an unrecoverable state if v8 throws a FatalError, actually
ask the operating system to dump core in this case.

Fixes #6836
2014-01-09 14:01:53 -08:00
Trevor Norris
646ac18d79 node: AsyncListener use separate storage mechanism
Before when an AsyncListener object was created and the "create"
callback returned a value, it was necessary to construct a new Object
with the same callbacks but add a place for the new storage value.

Now, instead, a separate storage array is kept on the context which is
used for any return value of the "create" callback. This significantly
reduces the number of Objects that need to be created.

Also added a flags property to the context to quickly check if a
specific callback was available either on the context or on the
AsyncListener instance itself.

Few other minor changes for readability that were difficult to separate
into their own commit.

This has not been optimized yet.
2014-01-09 13:47:03 -08:00
Trevor Norris
828f14556e src: revert domain using AsyncListeners
This is a slightly modified revert of bc39bdd.

Getting domains to use AsyncListeners became too much of a challenge
with many edge cases. While this is still a goal, it will have to be
deferred for now until more test coverage can be provided.
2014-01-09 13:25:20 -08:00
Fedor Indutny
0afdfae0eb configure: always set arm_float_abi
When not specified as a configure flag, and not derived from system
configuration, `arm_float_abi` should be set to `'default'`.

fix #6789
2014-01-09 01:08:29 +04:00
Fedor Indutny
730e511b35 child_process: better error reporting for exec
Report path to executable and argv on error, stderr is not enough in
many cases.

fix #6796
2014-01-09 00:00:30 +04:00
Fedor Indutny
4800310f6a deps: fix openssl assembly error on ia32 win32
`x86masm.pl` was mistakenly using .486 instruction set, why `cpuid` (and
perhaps others) are requiring .686 .
2014-01-08 23:40:24 +04:00
Lorenz Leutgeb
fc7e217a30 doc: fix typo in cluster page 2014-01-08 23:39:02 +04:00
Fedor Indutny
390598608c deps: update openssl to 1.0.1f 2014-01-08 02:43:17 +04:00
Timothy J Fontaine
30b3bc2f7c uv: Upgrade to v0.10.22 2014-01-07 14:05:58 -08:00
Ben Noordhuis
f057c7049e build: unconditionally disable -Werror
Forcibly disable -Werror, the old { 'werror': '' } hack in node.gyp
no longer works with newer versions of V8.

We support a wide range of compilers, it's simply not feasible to
squelch all warnings, never mind that the libraries in deps/ are
not under our control.

Fixes #6817.
2014-01-07 23:35:04 +04:00
isaacs
1be9365930 npm: Upgrade to 1.3.23 2014-01-06 17:02:07 -08:00
ayanamist
b922b5e90d stream: writes may return false but forget to emit drain
If a write is above the highWaterMark, _write still manages to
fully send it synchronously, _writableState.length will be adjusted down
to 0 synchronously with the write returning false, but 'drain' will
not be emitted until process.nextTick.

If another small write which is below highWaterMark is issued before
process.nextTick happens, _writableState.needDrain will be reset to false,
and the drain event will never be fired.

So we should check needDrain before setting it up, which prevents it
from inproperly resetting to false.
2014-01-05 19:44:45 +04:00
Lorenz Leutgeb
e1f4f6aa28 doc: Add forward secrecy section to TLS docs
This fixes confusion connected to comparison of ECDH
with RSA and wrong information on forward secrecy.
2014-01-05 17:15:08 +04:00
Fedor Indutny
92b6417098 crypto: introduce .setEngine(engine, [flags]) 2014-01-05 16:42:33 +04:00
Trevor Norris
a40b463674 node: properly check uid when adding AsyncListener
Instead of checking the uid on the array index of the queue, instead the
object property "uid" was checked on the queue iteself. Because this
will always evaluate to "undefined" the same listener could be added
multiple times to the same context.
2014-01-03 16:48:11 -08:00
Trevor Norris
d9fc6af32a node: change AsyncListener API
There was a flaw in the old API that has been fixed. Now the
asyncListener callback is now the "create" object property in the
callback object, and is optional.
2014-01-03 13:20:23 -08:00
Timothy J Fontaine
13eb17f412 Merge remote-tracking branch 'upstream/v0.10' 2013-12-31 16:28:49 -08:00
Timothy J Fontaine
aa56d9d354 blog: Post for v0.11.10 2013-12-31 16:24:58 -08:00
Timothy J Fontaine
c3e26d64f8 Now working on 0.11.11 2013-12-31 16:21:08 -08:00
Timothy J Fontaine
c039bc3a0e Merge branch 'v0.11.10-release' 2013-12-31 16:20:58 -08:00
Timothy J Fontaine
66931791f0 2013.12.31, Version 0.11.10 (Unstable)
* http_parser: update to 2.2

* uv: Upgrade to v0.11.17

* v8: Upgrade to 3.22.24.10

* buffer: optimize writeInt* methods (Paul Loyd)

* child_process: better error handling (Alexis Campailla)

* cluster: do not synchronously emit 'setup' event (Sam Roberts)

* cluster: restore backwards compatibility and various fixes (Sam Roberts)

* crypto: remove unnecessary OpenSSL_add_all_digests (Yorkie)

* crypto: support GCM authenticated encryption mode. (Ingmar Runge)

* dns: add resolveSoa and 'SOA' rrtype (Tuğrul Topuz)

* events: move EE c'tor guts to EventEmitter.init (Bert Belder)

* http: DELETE shouldn't default to chunked encoding (Lalit Kapoor)

* http: parse the status message in a http response. (Cam Swords)

* node: fix removing AsyncListener in callback (Vladimir Kurchatkin)

* node: follow specification, zero-fill ArrayBuffers (Trevor Norris)

* openssl: use ASM optimized routines (Fedor Indutny)

* process: allow nextTick infinite recursion (Trevor Norris)

* querystring: remove `name` from `stringify()` (Yorkie)

* timers: setImmediate v8 optimization fix (pflannery)

* tls: add serialNumber to getPeerCertificate() (Ben Noordhuis)

* tls: reintroduce socket.encrypted (Fedor Indutny)

* tls: fix handling of asterisk in SNI context (Fedor Indutny)

* util: Format negative zero as '-0' (David Chan)

* vm: fix race condition in timeout (Alexis Campailla)

* windows: fix dns lookup of localhost with ipv6 (Alexis Campailla)
2013-12-31 15:37:12 -08:00
Timothy J Fontaine
5ce4f3ec3d v8: Upgrade to 3.22.24.10 2013-12-31 15:02:38 -08:00
Timothy J Fontaine
08c83bb172 Merge remote-tracking branch 'upstream/v0.10' 2013-12-31 14:57:46 -08:00
Maciej Małecki
5a8de857f0 doc: document that process.send is synchronous
Ref #2598
2013-12-31 14:52:43 -08:00
Timothy J Fontaine
ffb718b5a3 doc: clarify process on exit safe usage 2013-12-31 14:48:20 -08:00
Ron Korving
3917232030 docs: process.on('exit') receives exit code
The fact that the "exit" event passes the exit code as an argument
as omitted from the documentation. This adds the explanation and
augments the example code to show that.
2013-12-31 14:38:09 -08:00
Tuğrul Topuz
bddea032b7 dns: add resolveSoa and 'SOA' rrtype
You can now query for SOA records by either passing 'SOA' to `resolve`
or by using the new `resolveSoa`
2013-12-31 14:30:40 -08:00
Timothy J Fontaine
13de0f1d27 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	lib/cluster.js
	lib/dgram.js
	lib/net.js
2013-12-31 13:56:15 -08:00
Timothy J Fontaine
6f8aa24d1e test: fix test-cluster-eaccess to work on windows 2013-12-31 11:57:13 -08:00
Sam Roberts
cb1646f44e test: fix assumption of worker exit on disconnect
Master was disconnecting its workers as soon as they both started up.
Meanwhile, the workers were trying to listen. Its a race, sometimes the
disconnect would happen between when worker gets the response message,
and acks that message with a 'listening'. This worked OK after v0.11
introduced a behaviour where disconnect would always exit the worker,
but once that backwards-incompatible behaviour is removed, the worker
lives long enough to try and respond to the master, and child_process
errors at the attempt to send from a disconnected child.
2013-12-31 11:43:44 -08:00
Sam Roberts
876d3bd85a cluster: do not synchronously emit 'setup' event
This is a problem present in both v0.10, and v0.11, where the 'setup'
event is synchronously emitted by `cluster.setupMaster()`, a mostly
harmless anti-pattern.
2013-12-31 11:43:44 -08:00
Sam Roberts
dce35146e0 cluster: only forcibly exit worker on unclean exit
Fix inadvertent v0.11 changes to the definition of suicide, particularly
the relationship between suicide state, the disconnect event, and when
exit should occur.

In v0.10, workers don't forcibly exit on disconnect, it doesn't give
them time to do a graceful finish of open client connections, they exit
under normal node rules - when there is nothing left to do. But on
unexpected disconnect they do exit so the workers aren't left around
after the master.

Note that a test as-written was invalid, it failed against the v0.10
cluster API, demonstrating that it was an undocumented API change.
2013-12-31 11:43:43 -08:00
Sam Roberts
6f40abe2d4 cluster: disconnect callback should always occur
Fixes issue in 0.11 where callback doesn't occur if worker count is
currently zero.  In 0.10 callback occurs after worker count is zero, and
occurs in next tick if worker count is currently zero.
2013-12-31 11:43:43 -08:00
Sam Roberts
3c649703c7 cluster: replace erroneous comma with semicolon 2013-12-31 11:43:43 -08:00
Timothy J Fontaine
8590f810a5 uv: Upgrade to v0.11.17 2013-12-31 10:33:54 -08:00
Fedor Indutny
3e9f2e61db cluster: report more errors to workers
Some errors for listening and binding to a socket were not properly
delivered to workers.

fix #6767
2013-12-31 09:47:33 -08:00
Benjamin Waters
58d6ca3a95 doc: Fix doc heading for 'response' event
Add colon to event heading to ensure it matches other events.

Fixes joyent/node#5687
2013-12-31 13:46:38 +04:00
Timothy J Fontaine
3dcb71f962 Merge remote-tracking branch 'upstream/v0.10' 2013-12-30 15:55:47 -08:00
Fedor Indutny
cb5da7b443 deps: update gyp to 828ce09 2013-12-30 15:52:47 -08:00
pflannery
7ced966a32 timers: setImmediate v8 optimization fix
Prevent v8 disabling optimization for scenario "bad value context for
arguments value".

Solves #6631

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2013-12-30 14:58:38 -08:00
Dav Glass
34b9280da4 doc: Fix missing backtick in debugger doc 2013-12-30 11:44:13 -08:00
Yorkie
8d3bc88bbe querystring: remove name from stringify()
QueryString.stringify() allowed a fourth argument that was used as a
conditional in the return value, but was undocumented, not used by core
and always was always false/undefiend. So the argument and conditional
have been removed.

Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2013-12-30 11:41:37 -08:00
Lev Gimelfarb
d2d56d04f8 build: add settings for VS 2013 to vcbuild.bat
Search for VS2013 compiler 1st, before falling back to older ones. This
allows compiling using the latest VS2013.
2013-12-28 16:58:01 +04:00
Fedor Indutny
96dffb1217 deps: update gyp to 828ce09 2013-12-27 20:06:12 +04:00
Benjamin Waters
8c4b2c35a4 doc: Missing word 'are' in documentation
Fix simple spelling mistake in documentation.

fix #5808
2013-12-26 21:17:19 +04:00
isaacs
7f82faee30 npm: Upgrade to v1.3.22 2013-12-25 19:15:23 -08:00
Vladimir Kurchatkin
055f7e9da9 src: only access stack of non-null errors
Avoid segmentation fault when `null` is thrown
2013-12-23 15:08:11 +04:00
Fedor Indutny
82098bb97b util: introduce CHECK_EQ/CHECK_NE 2013-12-20 18:57:46 -08:00
Trevor Norris
87cde44280 Revert "util: more strict check for bool/number/string"
This reverts commit 95ee84fabe.
2013-12-20 13:44:56 -08:00
Fedor Indutny
7c3643b767 tls: reintroduce socket.encrypted
Just a property that is always `true` for TLS sockets.

fix #6735
2013-12-21 01:03:05 +04:00
Paul Loyd
2ca6905160 buffer: optimize writeInt* methods
Remove unnecessary encoding within writeInt*
2013-12-21 01:01:17 +04:00
Bert Belder
54da818e4b events: move EE c'tor guts to EventEmitter.init
After landing 6ed861d it is no longer possible to reliably monkey-patch
the EventEmitter constructor. However there's valid use cases for that,
and makes for easier debugging. Therefore, move the guts of the
constructor to a separate function which is monkey-patchable.

Closes #6693
2013-12-20 12:47:24 -08:00
T.C. Hollingsworth
55b0bd639d build: install common.gypi along with headers
node-gyp requires this file
2013-12-20 11:03:06 -08:00
Alexis Campailla
f030d8426a test: fix flaky unit test test-fs-realpath.js
The test was not performing proper cleanup and so it would
fail if run more than one time on the same machine.
2013-12-20 20:40:28 +04:00
Alexis Campailla
ea18aecc82 test: case insensitve path comparison on Windows
Windows needs case insensitive comparison when it comes to
path strings.
2013-12-20 19:23:34 +04:00
Cam Swords
7ffe2ad616 http: parse the status message in a http response. 2013-12-20 17:55:08 +04:00
Fedor Indutny
a35a2f0192 deps: update http_parser to 2.2
Main changes:

* Added support for http statusMessage
2013-12-20 17:33:29 +04:00
Sam Roberts
a15c44b175 doc: describe the local domain path on Windows
The UNIX domain is also known as the LOCAL domain (AF_LOCAL), and
node/libuv implements it on Windows using named pipes. The API
documentation did not describe the naming rules for named pipes, and
also repeatedly described `listen(path)` as being UNIX, which it is not
on Windows.

Closes #6743
2013-12-19 14:59:11 -08:00
Timothy J Fontaine
5b96d6baf6 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	ChangeLog
	deps/uv/AUTHORS
	deps/uv/ChangeLog
	deps/uv/src/version.c
	deps/v8/src/log-utils.cc
	src/node_version.h
2013-12-19 09:33:46 -08:00
Timothy J Fontaine
f84c7a2776 blog: Post for v0.10.24 2013-12-19 09:05:14 -08:00
Timothy J Fontaine
00e28ee6a8 Now working on 0.10.25 2013-12-19 09:05:14 -08:00
Timothy J Fontaine
696ae46fd7 Merge branch 'v0.10.24-release' into v0.10 2013-12-19 09:03:45 -08:00
Yorkie
59fb0185ec crypto: remove unnecessary OpenSSL_add_all_digests
`OpenSSL_add_all_algorithms` implicitly adds both digests and
ciphers. No need in calling `OpenSSL_add_all_digests` after it.
2013-12-19 15:43:21 +04:00
Fedor Indutny
2394b974cc deps: v8 apply temporary fix until backport
Fix node.js debug build with a temporary v8 fix until the v8 team will
backport the fix from the more recent version of v8.

see https://code.google.com/p/v8/issues/detail?id=3062
2013-12-19 12:51:34 +04:00
Alexis Campailla
9be6470b53 windows: fix dns lookup of localhost with ipv6
Removing a hack intended to shortcut the resolution of 'localhost'
but which doesn't work for ipv6.
This was introduced in 2876141c42.
However it seems that the problems that this was trying to
circumvent has gone away ages ago, when dns resolution on
Windows started relying on Win32 GetAddrInfoW, which was
probably with be2320d408.

Fixes test-net-connect-options-ipv6.js on Windows.
2013-12-19 12:44:50 +04:00
Timothy J Fontaine
b7fd6bc899 2013.12.18, Version 0.10.24 (Stable)
* uv: Upgrade to v0.10.21

* npm: upgrade to 1.3.21

* v8: backport fix for CVE-2013-{6639|6640}

* build: unix install node and dep library headers (Timothy J Fontaine)

* cluster, v8: fix --logfile=%p.log (Ben Noordhuis)

* module: only cache package main (Wyatt Preul)
2013-12-18 15:49:45 -08:00
Timothy J Fontaine
9371be0aa1 uv: Upgrade to v0.10.21 2013-12-18 15:42:46 -08:00
Ben Noordhuis
2eaef9f6da cluster, v8: fix --logfile=%p.log
The %p is replaced with the current PID.  This used to work in node.js
v0.9.7 but it seems to have been lost somewhere along the way.

This commit makes the fix from 6b713b52 ("cluster: make --prof work for
workers") work again.  Without it, all log data ends up in a single
file and is unusable because the addresses are all wrong.
2013-12-18 15:36:12 -08:00
Alexis Campailla
cdc038ceb6 vm: fix race condition in timeout
Eliminate a race condition between uv_async_send and the closing of the
corresponding handle.

Also made errors in Watchdog constructor call abort()

Fixes #6088
2013-12-18 15:16:36 -08:00
Timothy J Fontaine
32478acf94 build: unix install node and dep library headers
Restores functionality from v0.8 where module authors may not be
relying on gyp for building their modules.
2013-12-18 15:06:20 -08:00
Yorkie
95ee84fabe util: more strict check for bool/number/string 2013-12-18 17:58:02 +04:00
isaacs
2a741f2d12 npm: upgrade to 1.3.21 2013-12-17 14:33:52 -08:00
isaacs
e10c223eb6 npm: upgrade to 1.3.20
The 1.3.19 release had a critical bug: any packages published with it
could not be installed, because the shasum would be incorrect.

Thankfully, 1.3.19 was published using 1.3.19, so could not be installed
by any users!  However, if it goes out as part of a Node.js release,
then obviously that would be a problem.
2013-12-17 09:04:30 -08:00
isaacs
97738994e0 npm: Upgrade to 1.3.19 2013-12-16 23:09:16 -08:00
Ahamed Nafeez
8a79cca80c crypto: comment change on disabling compression
This is a comment change, where it originally says disabling TLS
Compression protects against BEAST attack. But in fact, it is the
CRIME attack(Compression Ratio Info-leak Made Easy) that makes use
of TLS Compression and not BEAST.

BEAST(Browser Exploit Against SSL/TLS) is an entirely another variant
making use of the chosen boundary attack against CBC mode in
encryption.

Just making sure, that the exact reason for disabling TLS compression
must be made clear and not be misleading with some other attack.
2013-12-15 14:24:51 +04:00
Fedor Indutny
8803aa3af7 deps: update v8 to 3.22.24.9 2013-12-14 03:16:52 +04:00
Fedor Indutny
6b4dc61322 Merge branch 'v0.10'
Conflicts:
	deps/v8/src/elements-kind.cc
	deps/v8/src/elements-kind.h
	deps/v8/src/hydrogen-instructions.h
	deps/v8/src/hydrogen.cc
	deps/v8/src/lithium.cc
	deps/v8/src/lithium.h
2013-12-14 03:03:50 +04:00
jkummerow@chromium.org
39e2426b20 v8: backport fix for CVE-2013-{6639|6640}
Quoting CVE-2013-6639:

    The DehoistArrayIndex function in hydrogen-dehoist.cc in Google V8
    before 3.22.24.7, as used in Google Chrome before 31.0.1650.63,
    allows remote attackers to cause a denial of service (out-of-bounds
    write) or possibly have unspecified other impact via JavaScript code
    that sets the value of an array element with a crafted index.

Quoting CVE-2013-6640:

    The DehoistArrayIndex function in hydrogen-dehoist.cc in Google V8
    before 3.22.24.7, as used in Google Chrome before 31.0.1650.63,
    allows remote attackers to cause a denial of service (out-of-bounds
    read) via JavaScript code that sets a variable to the value of an
    array element with a crafted index.

Like 6b92a7, this is unlikely to affect node.js because it only runs
local, trusted code.  However, if there exists some module somewhere
that populates an array index with remotely provided data this could
very well be used to crash a remote server running node.  Defense in
depth and all.

This is a backport of upstream commit r17801. Original commit log:

    Limit size of dehoistable array indices

    LOG=Y
    BUG=chromium:319835,chromium:319860
    R=dslomov@chromium.org

    Review URL: https://codereview.chromium.org/74113002
2013-12-14 02:55:29 +04:00
Fedor Indutny
f61d9405bf uv: Upgrade to v0.11.16 2013-12-13 22:35:09 +04:00
Timothy J Fontaine
069dd07a17 Merge remote-tracking branch 'upstream/v0.10'
Conflicts:
	AUTHORS
	ChangeLog
	deps/uv/.mailmap
	deps/uv/ChangeLog
	deps/uv/build.mk
	deps/uv/src/unix/darwin.c
	deps/uv/src/unix/udp.c
	deps/uv/src/version.c
	deps/uv/test/test-list.h
	src/node_version.h
2013-12-12 11:32:41 -08:00
Wyatt Preul
1d5e797445 module: only cache package main 2013-12-12 09:38:47 -08:00
Lalit Kapoor
4d5489667c test: use s_client instead of curl
fixes #6647
2013-12-12 21:31:59 +04:00
Timothy J Fontaine
7dca8d714f blog: Post for v0.10.23 2013-12-11 22:11:19 -08:00
Timothy J Fontaine
bb1575b4c4 Now working on 0.10.24 2013-12-11 22:11:19 -08:00
Timothy J Fontaine
593672c33d Merge branch 'v0.10.23-release' into v0.10 2013-12-11 22:11:06 -08:00
Timothy J Fontaine
0462bc2356 2013.12.12, Version 0.10.23 (Stable)
* uv: Upgrade to v0.10.20 (Timothy J Fontaine)

* npm: Upgrade to 1.3.17 (isaacs)

* gyp: update to 78b26f7 (Timothy J Fontaine)

* build: include postmortem symbols on linux (Timothy J Fontaine)

* crypto: Make Decipher._flush() emit errors. (Kai Groner)

* dgram: fix abort when getting `fd` of closed dgram (Fedor Indutny)

* events: do not accept NaN in setMaxListeners (Fedor Indutny)

* events: avoid calling `once` functions twice (Tim Wood)

* events: fix TypeError in removeAllListeners (Jeremy Martin)

* fs: report correct path when EEXIST (Fedor Indutny)

* process: enforce allowed signals for kill (Sam Roberts)

* tls: emit 'end' on .receivedShutdown (Fedor Indutny)

* tls: fix potential data corruption (Fedor Indutny)

* tls: handle `ssl.start()` errors appropriately (Fedor Indutny)

* tls: reset NPN callbacks after SNI (Fedor Indutny)
2013-12-11 21:20:06 -08:00
Nicolas Kaiser
4bc2ec90d7 doc: fix typos in node.1 2013-12-11 20:41:36 -08:00
Mathias Bynens
f89a7185b7 doc: mention binary as deafult for Hash strings 2013-12-11 20:39:22 -08:00
Gabriel Farrell
04d52270b6 doc: "finish" event is on the writable stream 2013-12-11 20:29:17 -08:00
Timothy J Fontaine
910bc3c02d uv: Upgrade v0.10.20 2013-12-11 20:24:36 -08:00
Timothy J Fontaine
4ec189b250 gyp: update to 78b26f7 2013-12-11 20:06:11 -08:00
isaacs
a22de4f7ee npm: Upgrade to 1.3.17 2013-12-11 10:20:26 -08:00
Fedor Indutny
6f3d60388e gyp: build openssl-cli tool and use it in tests
fix #6663
2013-12-11 21:21:10 +04:00
Fedor Indutny
153784b348 openssl: fix keypress requirement in apps on win32
Original source:

http://openssl.6102.n7.nabble.com/PATCH-s-client-Fix-keypress-requirement-with-redirected-input-on-Windows-td46787.html
2013-12-11 21:21:00 +04:00
Alexis Campailla
c5d49ba9c2 test: test-os fix win32 localhost assumption
The test is expecting an invalid result for the loopback
interface network mask, but this issue was fixed in
libuv commit 1d5c61a8b31257733c41fb507762d3eb56eecb2d

Closes #5262 #6673
2013-12-10 22:16:24 -08:00
Alexis Campailla
ceea1e845a test: test-os win32 adhere standard tmp resolution
The test is making the wrong assumptions about the
value of os.tmpdir() on Windows
2013-12-10 22:13:05 -08:00
780 changed files with 24358 additions and 8031 deletions

16
AUTHORS
View File

@@ -498,3 +498,19 @@ Jacob Groundwater <groundwater@gmail.com>
Jackson Tian <shyvo1987@gmail.com>
fengmk2 <fengmk2@gmail.com>
Tim Wood <washwithcare@gmail.com>
Linus Unnebäck <linus@folkdatorn.se>
Nikolai Vavilov <vvnicholas@gmail.com>
Michael Ridgway <mcridgway@gmail.com>
Yazhong Liu <yorkiefixer@gmail.com>
Gabriel Falkenberg <gabriel.falkenberg@gmail.com>
Kai Groner <kai@gronr.com>
Steven Kabbes <stevenkabbes@gmail.com>
Gabriel Farrell <g@grrawr.com>
Nicolas Kaiser <nikai@nikai.net>
Ahamed Nafeez <ahamed.nafeez@gmail.com>
Cam Swords <cam.swords@gmail.com>
Paul Loyd <pavelko95@gmail.com>
Benjamin Waters <benjamin.waters@outlook.com>
Lev Gimelfarb <lev.gimelfarb@gmail.com>
Peter Flannery <flannery.peter@ntlworld.com>
Tuğrul Topuz <tugrultopuz@gmail.com>

103
ChangeLog
View File

@@ -1,4 +1,57 @@
2013.11.20, Version 0.11.9 (Unstable)
2013.12.31, Version 0.11.10 (Unstable)
* http_parser: update to 2.2
* uv: Upgrade to v0.11.17
* v8: Upgrade to 3.22.24.10
* buffer: optimize writeInt* methods (Paul Loyd)
* child_process: better error handling (Alexis Campailla)
* cluster: do not synchronously emit 'setup' event (Sam Roberts)
* cluster: restore backwards compatibility and various fixes (Sam Roberts)
* crypto: remove unnecessary OpenSSL_add_all_digests (Yorkie)
* crypto: support GCM authenticated encryption mode. (Ingmar Runge)
* dns: add resolveSoa and 'SOA' rrtype (Tuğrul Topuz)
* events: move EE c'tor guts to EventEmitter.init (Bert Belder)
* http: DELETE shouldn't default to chunked encoding (Lalit Kapoor)
* http: parse the status message in a http response. (Cam Swords)
* node: fix removing AsyncListener in callback (Vladimir Kurchatkin)
* node: follow specification, zero-fill ArrayBuffers (Trevor Norris)
* openssl: use ASM optimized routines (Fedor Indutny)
* process: allow nextTick infinite recursion (Trevor Norris)
* querystring: remove `name` from `stringify()` (Yorkie)
* timers: setImmediate v8 optimization fix (pflannery)
* tls: add serialNumber to getPeerCertificate() (Ben Noordhuis)
* tls: reintroduce socket.encrypted (Fedor Indutny)
* tls: fix handling of asterisk in SNI context (Fedor Indutny)
* util: Format negative zero as '-0' (David Chan)
* vm: fix race condition in timeout (Alexis Campailla)
* windows: fix dns lookup of localhost with ipv6 (Alexis Campailla)
2013.11.20, Version 0.11.9 (Unstable), dcfd032bdd69dfb38c120e18438d6316ae522edc
* uv: upgrade to v0.11.15 (Timothy J Fontaine)
@@ -392,6 +445,54 @@
* console: `console.dir()` bypasses inspect() methods (Nathan Rajlich)
2013.12.18, Version 0.10.24 (Stable), b7fd6bc899ccb629d790c47aee06aba87e535c41
* uv: Upgrade to v0.10.21
* npm: upgrade to 1.3.21
* v8: backport fix for CVE-2013-{6639|6640}
* build: unix install node and dep library headers (Timothy J Fontaine)
* cluster, v8: fix --logfile=%p.log (Ben Noordhuis)
* module: only cache package main (Wyatt Preul)
2013.12.12, Version 0.10.23 (Stable), 0462bc23564e7e950a70ae4577a840b04db6c7c6
* uv: Upgrade to v0.10.20 (Timothy J Fontaine)
* npm: Upgrade to 1.3.17 (isaacs)
* gyp: update to 78b26f7 (Timothy J Fontaine)
* build: include postmortem symbols on linux (Timothy J Fontaine)
* crypto: Make Decipher._flush() emit errors. (Kai Groner)
* dgram: fix abort when getting `fd` of closed dgram (Fedor Indutny)
* events: do not accept NaN in setMaxListeners (Fedor Indutny)
* events: avoid calling `once` functions twice (Tim Wood)
* events: fix TypeError in removeAllListeners (Jeremy Martin)
* fs: report correct path when EEXIST (Fedor Indutny)
* process: enforce allowed signals for kill (Sam Roberts)
* tls: emit 'end' on .receivedShutdown (Fedor Indutny)
* tls: fix potential data corruption (Fedor Indutny)
* tls: handle `ssl.start()` errors appropriately (Fedor Indutny)
* tls: reset NPN callbacks after SNI (Fedor Indutny)
2013.11.12, Version 0.10.22 (Stable), cbff8f091c22fb1df6b238c7a1b9145db950fa65
* npm: Upgrade to 1.3.14

View File

@@ -131,6 +131,9 @@ test-pummel: all
test-internet: all
$(PYTHON) tools/test.py internet
test-debugger: all
$(PYTHON) tools/test.py debugger
test-npm: node
./node deps/npm/test/run.js

View File

@@ -103,6 +103,10 @@
},
}
},
# Forcibly disable -Werror. We support a wide range of compilers, it's
# simply not feasible to squelch all warnings, never mind that the
# libraries in deps/ are not under our control.
'cflags!': ['-Werror'],
'msvs_settings': {
'VCCLCompilerTool': {
'StringPooling': 'true', # pool string literals

2
configure vendored
View File

@@ -431,7 +431,7 @@ def configure_arm(o):
elif is_arm_hard_float_abi():
arm_float_abi = 'hard'
else:
'default'
arm_float_abi = 'default'
o['variables']['armv7'] = int(is_arch_armv7())
o['variables']['arm_fpu'] = 'vfpv3' # V8 3.18 no longer supports VFP2.
o['variables']['arm_neon'] = int(is_arm_neon())

View File

@@ -1,3 +1,4 @@
/out/
core
tags
*.o
@@ -5,7 +6,9 @@ test
test_g
test_fast
url_parser
parsertrace
parsertrace_g
*.mk
*.Makefile
*.so
*.so.*
*.a

View File

@@ -3,3 +3,5 @@
Ryan Dahl <ry@tinyclouds.org>
Salman Haq <salman.haq@asti-usa.com>
Simon Zimmermann <simonz05@gmail.com>
Thomas LE ROUX <thomas@november-eleven.fr> LE ROUX Thomas <thomas@procheo.fr>
Thomas LE ROUX <thomas@november-eleven.fr> Thomas LE ROUX <thomas@procheo.fr>

13
deps/http_parser/.travis.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
language: c
compiler:
- clang
- gcc
script:
- "make"
notifications:
email: false
irc:
- "irc.freenode.net#libuv"

View File

@@ -28,10 +28,20 @@ Andre Caron <andre.l.caron@gmail.com>
Ivo Raisr <ivosh@ivosh.net>
James McLaughlin <jamie@lacewing-project.org>
David Gwynne <loki@animata.net>
LE ROUX Thomas <thomas@procheo.fr>
Thomas LE ROUX <thomas@november-eleven.fr>
Randy Rizun <rrizun@ortivawireless.com>
Andre Louis Caron <andre.louis.caron@usherbrooke.ca>
Simon Zimmermann <simonz05@gmail.com>
Erik Dubbelboer <erik@dubbelboer.com>
Martell Malone <martellmalone@gmail.com>
Bertrand Paquet <bpaquet@octo.com>
BogDan Vatra <bogdan@kde.org>
Peter Faiman <peter@thepicard.org>
Corey Richardson <corey@octayn.net>
Tóth Tamás <tomika_nospam@freemail.hu>
Patrik Stutz <patrik.stutz@gmail.com>
Cam Swords <cam.swords@gmail.com>
Chris Dickinson <christopher.s.dickinson@gmail.com>
Uli Köhler <ukoehler@btronik.de>
Charlie Somerville <charlie@charliesomerville.com>
Fedor Indutny <fedor.indutny@gmail.com>

View File

@@ -1,10 +1,33 @@
# Copyright Joyent, Inc. and other Node contributors. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
SONAME ?= libhttp_parser.so.2.2
CC?=gcc
AR?=ar
CPPFLAGS += -I.
CPPFLAGS_DEBUG = $(CPPFLAGS) -DHTTP_PARSER_STRICT=1 -DHTTP_PARSER_DEBUG=1
CPPFLAGS_DEBUG = $(CPPFLAGS) -DHTTP_PARSER_STRICT=1
CPPFLAGS_DEBUG += $(CPPFLAGS_DEBUG_EXTRA)
CPPFLAGS_FAST = $(CPPFLAGS) -DHTTP_PARSER_STRICT=0 -DHTTP_PARSER_DEBUG=0
CPPFLAGS_FAST = $(CPPFLAGS) -DHTTP_PARSER_STRICT=0
CPPFLAGS_FAST += $(CPPFLAGS_FAST_EXTRA)
CFLAGS += -Wall -Wextra -Werror
@@ -12,6 +35,13 @@ CFLAGS_DEBUG = $(CFLAGS) -O0 -g $(CFLAGS_DEBUG_EXTRA)
CFLAGS_FAST = $(CFLAGS) -O3 $(CFLAGS_FAST_EXTRA)
CFLAGS_LIB = $(CFLAGS_FAST) -fPIC
LDFLAGS_LIB = $(LDFLAGS) -shared
ifneq (darwin,$(PLATFORM))
# TODO(bnoordhuis) The native SunOS linker expects -h rather than -soname...
LDFLAGS_LIB += -Wl,-soname=$(SONAME)
endif
test: test_g test_fast
./test_g
./test_fast
@@ -31,12 +61,6 @@ test_fast: http_parser.o test.o http_parser.h
test.o: test.c http_parser.h Makefile
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) -c test.c -o $@
url_parser: http_parser_g.o url_parser.o
$(CC) $(CFLAGS_DEBUG) $(LDFLAGS) http_parser_g.o url_parser.o -o $@
url_parser.o: url_parser.c http_parser.h Makefile
$(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) -c url_parser.c -o $@
http_parser.o: http_parser.c http_parser.h Makefile
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) -c http_parser.c
@@ -50,15 +74,32 @@ libhttp_parser.o: http_parser.c http_parser.h Makefile
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_LIB) -c http_parser.c -o libhttp_parser.o
library: libhttp_parser.o
$(CC) -shared -o libhttp_parser.so libhttp_parser.o
$(CC) $(LDFLAGS_LIB) -o $(SONAME) $<
package: http_parser.o
$(AR) rcs libhttp_parser.a http_parser.o
url_parser: http_parser.o contrib/url_parser.c
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) $^ -o $@
url_parser_g: http_parser_g.o contrib/url_parser.c
$(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o $@
parsertrace: http_parser.o contrib/parsertrace.c
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) $^ -o parsertrace
parsertrace_g: http_parser_g.o contrib/parsertrace.c
$(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o parsertrace_g
tags: http_parser.c http_parser.h test.c
ctags $^
clean:
rm -f *.o *.a test test_fast test_g url_parser http_parser.tar tags libhttp_parser.so libhttp_parser.o
rm -f *.o *.a tags test test_fast test_g \
http_parser.tar libhttp_parser.so.* \
url_parser url_parser_g parsertrace parsertrace_g
contrib/url_parser.c: http_parser.h
contrib/parsertrace.c: http_parser.h
.PHONY: clean package test-run test-run-timed test-valgrind

View File

@@ -1,6 +1,8 @@
HTTP Parser
===========
[![Build Status](https://travis-ci.org/joyent/http-parser.png?branch=master)](https://travis-ci.org/joyent/http-parser)
This is a parser for HTTP messages written in C. It parses both requests and
responses. The parser is designed to be used in performance HTTP
applications. It does not make any syscalls nor allocations, it does not
@@ -34,38 +36,41 @@ Usage
One `http_parser` object is used per TCP connection. Initialize the struct
using `http_parser_init()` and set the callbacks. That might look something
like this for a request parser:
```c
http_parser_settings settings;
settings.on_url = my_url_callback;
settings.on_header_field = my_header_field_callback;
/* ... */
http_parser_settings settings;
settings.on_path = my_path_callback;
settings.on_header_field = my_header_field_callback;
/* ... */
http_parser *parser = malloc(sizeof(http_parser));
http_parser_init(parser, HTTP_REQUEST);
parser->data = my_socket;
http_parser *parser = malloc(sizeof(http_parser));
http_parser_init(parser, HTTP_REQUEST);
parser->data = my_socket;
```
When data is received on the socket execute the parser and check for errors.
size_t len = 80*1024, nparsed;
char buf[len];
ssize_t recved;
```c
size_t len = 80*1024, nparsed;
char buf[len];
ssize_t recved;
recved = recv(fd, buf, len, 0);
recved = recv(fd, buf, len, 0);
if (recved < 0) {
/* Handle error. */
}
if (recved < 0) {
/* Handle error. */
}
/* Start up / continue the parser.
* Note we pass recved==0 to signal that EOF has been recieved.
*/
nparsed = http_parser_execute(parser, &settings, buf, recved);
/* Start up / continue the parser.
* Note we pass recved==0 to signal that EOF has been recieved.
*/
nparsed = http_parser_execute(parser, &settings, buf, recved);
if (parser->upgrade) {
/* handle new protocol */
} else if (nparsed != recved) {
/* Handle error. Usually just close the connection. */
}
if (parser->upgrade) {
/* handle new protocol */
} else if (nparsed != recved) {
/* Handle error. Usually just close the connection. */
}
```
HTTP needs to know where the end of the stream is. For example, sometimes
servers send responses without Content-Length and expect the client to

156
deps/http_parser/contrib/parsertrace.c vendored Normal file
View File

@@ -0,0 +1,156 @@
/* Based on src/http/ngx_http_parse.c from NGINX copyright Igor Sysoev
*
* Additional changes are licensed under the same terms as NGINX and
* copyright Joyent, Inc. and other Node contributors. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
/* Dump what the parser finds to stdout as it happen */
#include "http_parser.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int on_message_begin(http_parser* _) {
(void)_;
printf("\n***MESSAGE BEGIN***\n\n");
return 0;
}
int on_headers_complete(http_parser* _) {
(void)_;
printf("\n***HEADERS COMPLETE***\n\n");
return 0;
}
int on_message_complete(http_parser* _) {
(void)_;
printf("\n***MESSAGE COMPLETE***\n\n");
return 0;
}
int on_url(http_parser* _, const char* at, size_t length) {
(void)_;
printf("Url: %.*s\n", (int)length, at);
return 0;
}
int on_header_field(http_parser* _, const char* at, size_t length) {
(void)_;
printf("Header field: %.*s\n", (int)length, at);
return 0;
}
int on_header_value(http_parser* _, const char* at, size_t length) {
(void)_;
printf("Header value: %.*s\n", (int)length, at);
return 0;
}
int on_body(http_parser* _, const char* at, size_t length) {
(void)_;
printf("Body: %.*s\n", (int)length, at);
return 0;
}
void usage(const char* name) {
fprintf(stderr,
"Usage: %s $type $filename\n"
" type: -x, where x is one of {r,b,q}\n"
" parses file as a Response, reQuest, or Both\n",
name);
exit(EXIT_FAILURE);
}
int main(int argc, char* argv[]) {
enum http_parser_type file_type;
if (argc != 3) {
usage(argv[0]);
}
char* type = argv[1];
if (type[0] != '-') {
usage(argv[0]);
}
switch (type[1]) {
/* in the case of "-", type[1] will be NUL */
case 'r':
file_type = HTTP_RESPONSE;
break;
case 'q':
file_type = HTTP_REQUEST;
break;
case 'b':
file_type = HTTP_BOTH;
break;
default:
usage(argv[0]);
}
char* filename = argv[2];
FILE* file = fopen(filename, "r");
if (file == NULL) {
perror("fopen");
return EXIT_FAILURE;
}
fseek(file, 0, SEEK_END);
long file_length = ftell(file);
if (file_length == -1) {
perror("ftell");
return EXIT_FAILURE;
}
fseek(file, 0, SEEK_SET);
char* data = malloc(file_length);
if (fread(data, 1, file_length, file) != (size_t)file_length) {
fprintf(stderr, "couldn't read entire file\n");
free(data);
return EXIT_FAILURE;
}
http_parser_settings settings;
memset(&settings, 0, sizeof(settings));
settings.on_message_begin = on_message_begin;
settings.on_url = on_url;
settings.on_header_field = on_header_field;
settings.on_header_value = on_header_value;
settings.on_headers_complete = on_headers_complete;
settings.on_body = on_body;
settings.on_message_complete = on_message_complete;
http_parser parser;
http_parser_init(&parser, file_type);
size_t nparsed = http_parser_execute(&parser, &settings, data, file_length);
free(data);
if (nparsed != (size_t)file_length) {
fprintf(stderr,
"Error: %s (%s)\n",
http_errno_description(HTTP_PARSER_ERRNO(&parser)),
http_errno_name(HTTP_PARSER_ERRNO(&parser)));
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}

View File

@@ -51,18 +51,10 @@
# define ELEM_AT(a, i, v) ((unsigned int) (i) < ARRAY_SIZE(a) ? (a)[(i)] : (v))
#endif
#if HTTP_PARSER_DEBUG
#define SET_ERRNO(e) \
do { \
parser->http_errno = (e); \
parser->error_lineno = __LINE__; \
} while (0)
#else
#define SET_ERRNO(e) \
do { \
parser->http_errno = (e); \
} while(0)
#endif
/* Run the notify callback FOR, returning ER if it fails */
@@ -256,6 +248,7 @@ enum state
, s_res_http_minor
, s_res_first_status_code
, s_res_status_code
, s_res_status_start
, s_res_status
, s_res_line_almost_done
@@ -589,6 +582,7 @@ size_t http_parser_execute (http_parser *parser,
const char *header_value_mark = 0;
const char *url_mark = 0;
const char *body_mark = 0;
const char *status_mark = 0;
/* We're in an error state. Don't bother doing anything. */
if (HTTP_PARSER_ERRNO(parser) != HPE_OK) {
@@ -635,6 +629,9 @@ size_t http_parser_execute (http_parser *parser,
case s_req_fragment:
url_mark = data;
break;
case s_res_status:
status_mark = data;
break;
}
for (p=data; p != data + len; p++) {
@@ -642,7 +639,17 @@ size_t http_parser_execute (http_parser *parser,
if (PARSING_HEADER(parser->state)) {
++parser->nread;
/* Buffer overflow attack */
/* Don't allow the total size of the HTTP headers (including the status
* line) to exceed HTTP_MAX_HEADER_SIZE. This check is here to protect
* embedders against denial-of-service attacks where the attacker feeds
* us a never-ending header that the embedder keeps buffering.
*
* This check is arguably the responsibility of embedders but we're doing
* it on the embedder's behalf because most won't bother and this way we
* make the web a little safer. HTTP_MAX_HEADER_SIZE is still far bigger
* than any reasonable request or response so this should never affect
* day-to-day operation.
*/
if (parser->nread > HTTP_MAX_HEADER_SIZE) {
SET_ERRNO(HPE_HEADER_OVERFLOW);
goto error;
@@ -831,7 +838,7 @@ size_t http_parser_execute (http_parser *parser,
if (!IS_NUM(ch)) {
switch (ch) {
case ' ':
parser->state = s_res_status;
parser->state = s_res_status_start;
break;
case CR:
parser->state = s_res_line_almost_done;
@@ -857,9 +864,8 @@ size_t http_parser_execute (http_parser *parser,
break;
}
case s_res_status:
/* the human readable status. e.g. "NOT FOUND"
* we are not humans so just ignore this */
case s_res_status_start:
{
if (ch == CR) {
parser->state = s_res_line_almost_done;
break;
@@ -869,6 +875,26 @@ size_t http_parser_execute (http_parser *parser,
parser->state = s_header_field_start;
break;
}
MARK(status);
parser->state = s_res_status;
parser->index = 0;
break;
}
case s_res_status:
if (ch == CR) {
parser->state = s_res_line_almost_done;
CALLBACK_DATA(status);
break;
}
if (ch == LF) {
parser->state = s_header_field_start;
CALLBACK_DATA(status);
break;
}
break;
case s_res_line_almost_done:
@@ -1851,12 +1877,14 @@ size_t http_parser_execute (http_parser *parser,
assert(((header_field_mark ? 1 : 0) +
(header_value_mark ? 1 : 0) +
(url_mark ? 1 : 0) +
(body_mark ? 1 : 0)) <= 1);
(body_mark ? 1 : 0) +
(status_mark ? 1 : 0)) <= 1);
CALLBACK_DATA_NOADVANCE(header_field);
CALLBACK_DATA_NOADVANCE(header_value);
CALLBACK_DATA_NOADVANCE(url);
CALLBACK_DATA_NOADVANCE(body);
CALLBACK_DATA_NOADVANCE(status);
return len;
@@ -1987,7 +2015,7 @@ http_parse_host_char(enum http_host_state s, const char ch) {
/* FALLTHROUGH */
case s_http_host_v6_start:
if (IS_HEX(ch) || ch == ':') {
if (IS_HEX(ch) || ch == ':' || ch == '.') {
return s_http_host_v6;
}
@@ -2192,3 +2220,15 @@ http_parser_pause(http_parser *parser, int paused) {
assert(0 && "Attempting to pause parser in error state");
}
}
int
http_body_is_final(const struct http_parser *parser) {
return parser->state == s_message_done;
}
unsigned long
http_parser_version(void) {
return HTTP_PARSER_VERSION_MAJOR * 0x10000 |
HTTP_PARSER_VERSION_MINOR * 0x00100 |
HTTP_PARSER_VERSION_PATCH * 0x00001;
}

View File

@@ -12,6 +12,7 @@
# RuntimeLibrary MUST MATCH across the entire project
'Debug': {
'defines': [ 'DEBUG', '_DEBUG' ],
'cflags': [ '-Wall', '-Wextra', '-O0', '-g', '-ftrapv' ],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 1, # static debug
@@ -20,6 +21,7 @@
},
'Release': {
'defines': [ 'NDEBUG' ],
'cflags': [ '-Wall', '-Wextra', '-O3' ],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 0, # static release
@@ -51,6 +53,7 @@
'type': 'static_library',
'include_dirs': [ '.' ],
'direct_dependent_settings': {
'defines': [ 'HTTP_PARSER_STRICT=0' ],
'include_dirs': [ '.' ],
},
'defines': [ 'HTTP_PARSER_STRICT=0' ],
@@ -69,11 +72,40 @@
},
{
'target_name': 'test',
'target_name': 'http_parser_strict',
'type': 'static_library',
'include_dirs': [ '.' ],
'direct_dependent_settings': {
'defines': [ 'HTTP_PARSER_STRICT=1' ],
'include_dirs': [ '.' ],
},
'defines': [ 'HTTP_PARSER_STRICT=1' ],
'sources': [ './http_parser.c', ],
'conditions': [
['OS=="win"', {
'msvs_settings': {
'VCCLCompilerTool': {
# Compile as C++. http_parser.c is actually C99, but C++ is
# close enough in this case.
'CompileAs': 2,
},
},
}]
],
},
{
'target_name': 'test-nonstrict',
'type': 'executable',
'dependencies': [ 'http_parser' ],
'sources': [ 'test.c' ]
},
{
'target_name': 'test-strict',
'type': 'executable',
'dependencies': [ 'http_parser_strict' ],
'sources': [ 'test.c' ]
}
]
}

View File

@@ -24,12 +24,15 @@
extern "C" {
#endif
#define HTTP_PARSER_VERSION_MAJOR 1
#define HTTP_PARSER_VERSION_MINOR 0
/* Also update SONAME in the Makefile whenever you change these. */
#define HTTP_PARSER_VERSION_MAJOR 2
#define HTTP_PARSER_VERSION_MINOR 2
#define HTTP_PARSER_VERSION_PATCH 0
#include <sys/types.h>
#if defined(_WIN32) && !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER<1600)
#include <BaseTsd.h>
#include <stddef.h>
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
@@ -38,8 +41,6 @@ typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
typedef SIZE_T size_t;
typedef SSIZE_T ssize_t;
#else
#include <stdint.h>
#endif
@@ -51,14 +52,6 @@ typedef SSIZE_T ssize_t;
# define HTTP_PARSER_STRICT 1
#endif
/* Compile with -DHTTP_PARSER_DEBUG=1 to add extra debugging information to
* the error reporting facility.
*/
#ifndef HTTP_PARSER_DEBUG
# define HTTP_PARSER_DEBUG 0
#endif
/* Maximium header size allowed */
#define HTTP_MAX_HEADER_SIZE (80*1024)
@@ -77,7 +70,7 @@ typedef struct http_parser_settings http_parser_settings;
* chunked' headers that indicate the presence of a body.
*
* http_data_cb does not return data chunks. It will be call arbitrarally
* many times for each string. E.G. you might get 10 callbacks for "on_path"
* many times for each string. E.G. you might get 10 callbacks for "on_url"
* each providing just a few characters more data.
*/
typedef int (*http_data_cb) (http_parser*, const char *at, size_t length);
@@ -156,6 +149,7 @@ enum flags
XX(CB_headers_complete, "the on_headers_complete callback failed") \
XX(CB_body, "the on_body callback failed") \
XX(CB_message_complete, "the on_message_complete callback failed") \
XX(CB_status, "the on_status callback failed") \
\
/* Parsing-related errors */ \
XX(INVALID_EOF_STATE, "stream ended at an unexpected time") \
@@ -196,21 +190,14 @@ enum http_errno {
/* Get an http_errno value from an http_parser */
#define HTTP_PARSER_ERRNO(p) ((enum http_errno) (p)->http_errno)
/* Get the line number that generated the current error */
#if HTTP_PARSER_DEBUG
#define HTTP_PARSER_ERRNO_LINE(p) ((p)->error_lineno)
#else
#define HTTP_PARSER_ERRNO_LINE(p) 0
#endif
struct http_parser {
/** PRIVATE **/
unsigned char type : 2; /* enum http_parser_type */
unsigned char flags : 6; /* F_* values from 'flags' enum; semi-public */
unsigned char state; /* enum state from http_parser.c */
unsigned char header_state; /* enum header_state from http_parser.c */
unsigned char index; /* index into current matcher */
unsigned int type : 2; /* enum http_parser_type */
unsigned int flags : 6; /* F_* values from 'flags' enum; semi-public */
unsigned int state : 8; /* enum state from http_parser.c */
unsigned int header_state : 8; /* enum header_state from http_parser.c */
unsigned int index : 8; /* index into current matcher */
uint32_t nread; /* # bytes read in various scenarios */
uint64_t content_length; /* # bytes in body (0 if no Content-Length header) */
@@ -218,20 +205,16 @@ struct http_parser {
/** READ-ONLY **/
unsigned short http_major;
unsigned short http_minor;
unsigned short status_code; /* responses only */
unsigned char method; /* requests only */
unsigned char http_errno : 7;
unsigned int status_code : 16; /* responses only */
unsigned int method : 8; /* requests only */
unsigned int http_errno : 7;
/* 1 = Upgrade header was present and the parser has exited because of that.
* 0 = No upgrade header present.
* Should be checked when http_parser_execute() returns in addition to
* error checking.
*/
unsigned char upgrade : 1;
#if HTTP_PARSER_DEBUG
uint32_t error_lineno;
#endif
unsigned int upgrade : 1;
/** PUBLIC **/
void *data; /* A pointer to get hook to the "connection" or "socket" object */
@@ -241,6 +224,7 @@ struct http_parser {
struct http_parser_settings {
http_cb on_message_begin;
http_data_cb on_url;
http_data_cb on_status;
http_data_cb on_header_field;
http_data_cb on_header_value;
http_cb on_headers_complete;
@@ -279,6 +263,18 @@ struct http_parser_url {
};
/* Returns the library version. Bits 16-23 contain the major version number,
* bits 8-15 the minor version number and bits 0-7 the patch level.
* Usage example:
*
* unsigned long version = http_parser_version();
* unsigned major = (version >> 16) & 255;
* unsigned minor = (version >> 8) & 255;
* unsigned patch = version & 255;
* printf("http_parser v%u.%u.%u\n", major, minor, version);
*/
unsigned long http_parser_version(void);
void http_parser_init(http_parser *parser, enum http_parser_type type);
@@ -313,6 +309,9 @@ int http_parser_parse_url(const char *buf, size_t buflen,
/* Pause or un-pause the parser; a nonzero value pauses */
void http_parser_pause(http_parser *parser, int paused);
/* Checks if this is the final chunk of the body. */
int http_body_is_final(const http_parser *parser);
#ifdef __cplusplus
}
#endif

View File

@@ -26,13 +26,19 @@
#include <string.h>
#include <stdarg.h>
#if defined(__APPLE__)
# undef strlcat
# undef strlncpy
# undef strlcpy
#endif /* defined(__APPLE__) */
#undef TRUE
#define TRUE 1
#undef FALSE
#define FALSE 0
#define MAX_HEADERS 13
#define MAX_ELEMENT_SIZE 500
#define MAX_ELEMENT_SIZE 2048
#define MIN(a,b) ((a) < (b) ? (a) : (b))
@@ -44,6 +50,7 @@ struct message {
enum http_parser_type type;
enum http_method method;
int status_code;
char response_status[MAX_ELEMENT_SIZE];
char request_path[MAX_ELEMENT_SIZE];
char request_url[MAX_ELEMENT_SIZE];
char fragment[MAX_ELEMENT_SIZE];
@@ -67,6 +74,7 @@ struct message {
int headers_complete_cb_called;
int message_complete_cb_called;
int message_complete_on_eof;
int body_is_final;
};
static int currently_parsing_eof;
@@ -926,6 +934,7 @@ const struct message responses[] =
,.http_major= 1
,.http_minor= 1
,.status_code= 301
,.response_status= "Moved Permanently"
,.num_headers= 8
,.headers=
{ { "Location", "http://www.google.com/" }
@@ -974,6 +983,7 @@ const struct message responses[] =
,.http_major= 1
,.http_minor= 1
,.status_code= 200
,.response_status= "OK"
,.num_headers= 5
,.headers=
{ { "Date", "Tue, 04 Aug 2009 07:59:32 GMT" }
@@ -1002,6 +1012,7 @@ const struct message responses[] =
,.http_major= 1
,.http_minor= 1
,.status_code= 404
,.response_status= "Not Found"
,.num_headers= 0
,.headers= {}
,.body_size= 0
@@ -1017,6 +1028,7 @@ const struct message responses[] =
,.http_major= 1
,.http_minor= 1
,.status_code= 301
,.response_status= ""
,.num_headers= 0
,.headers= {}
,.body= ""
@@ -1042,6 +1054,7 @@ const struct message responses[] =
,.http_major= 1
,.http_minor= 1
,.status_code= 200
,.response_status= "OK"
,.num_headers= 2
,.headers=
{ {"Content-Type", "text/plain" }
@@ -1067,6 +1080,7 @@ const struct message responses[] =
,.http_major= 1
,.http_minor= 1
,.status_code= 200
,.response_status= "OK"
,.num_headers= 2
,.headers=
{ {"Content-Type", "text/html; charset=utf-8" }
@@ -1090,6 +1104,7 @@ const struct message responses[] =
,.http_major= 1
,.http_minor= 1
,.status_code= 200
,.response_status= "OK"
,.num_headers= 4
,.headers=
{ {"Content-Type", "text/html; charset=UTF-8" }
@@ -1115,6 +1130,7 @@ const struct message responses[] =
,.http_major= 1
,.http_minor= 1
,.status_code= 200
,.response_status= "OK"
,.num_headers= 4
,.headers=
{ {"Server", "DCLK-AdSvr" }
@@ -1147,6 +1163,7 @@ const struct message responses[] =
,.http_major= 1
,.http_minor= 0
,.status_code= 301
,.response_status= "Moved Permanently"
,.num_headers= 9
,.headers=
{ { "Date", "Thu, 03 Jun 2010 09:56:32 GMT" }
@@ -1185,6 +1202,7 @@ const struct message responses[] =
,.http_major= 1
,.http_minor= 1
,.status_code= 200
,.response_status= "OK"
,.num_headers= 11
,.headers=
{ { "Date", "Tue, 28 Sep 2010 01:14:13 GMT" }
@@ -1216,6 +1234,7 @@ const struct message responses[] =
,.http_major= 1
,.http_minor= 1
,.status_code= 500
,.response_status= "Oriëntatieprobleem"
,.num_headers= 3
,.headers=
{ { "Date", "Fri, 5 Nov 2010 23:07:12 GMT+2" }
@@ -1236,6 +1255,7 @@ const struct message responses[] =
,.http_major= 0
,.http_minor= 9
,.status_code= 200
,.response_status= "OK"
,.num_headers= 0
,.headers=
{}
@@ -1258,6 +1278,7 @@ const struct message responses[] =
,.http_major= 1
,.http_minor= 1
,.status_code= 200
,.response_status= "OK"
,.num_headers= 1
,.headers=
{ { "Content-Type", "text/plain" }
@@ -1276,6 +1297,7 @@ const struct message responses[] =
,.http_major= 1
,.http_minor= 0
,.status_code= 200
,.response_status= "OK"
,.num_headers= 1
,.headers=
{ { "Connection", "keep-alive" }
@@ -1295,6 +1317,7 @@ const struct message responses[] =
,.http_major= 1
,.http_minor= 0
,.status_code= 204
,.response_status= "No content"
,.num_headers= 1
,.headers=
{ { "Connection", "keep-alive" }
@@ -1313,6 +1336,7 @@ const struct message responses[] =
,.http_major= 1
,.http_minor= 1
,.status_code= 200
,.response_status= "OK"
,.num_headers= 0
,.headers={}
,.body_size= 0
@@ -1329,6 +1353,7 @@ const struct message responses[] =
,.http_major= 1
,.http_minor= 1
,.status_code= 204
,.response_status= "No content"
,.num_headers= 0
,.headers={}
,.body_size= 0
@@ -1346,6 +1371,7 @@ const struct message responses[] =
,.http_major= 1
,.http_minor= 1
,.status_code= 204
,.response_status= "No content"
,.num_headers= 1
,.headers=
{ { "Connection", "close" }
@@ -1367,6 +1393,7 @@ const struct message responses[] =
,.http_major= 1
,.http_minor= 1
,.status_code= 200
,.response_status= "OK"
,.num_headers= 1
,.headers=
{ { "Transfer-Encoding", "chunked" }
@@ -1395,6 +1422,7 @@ const struct message responses[] =
,.http_major= 1
,.http_minor= 1
,.status_code= 200
,.response_status= "OK"
,.num_headers= 7
,.headers=
{ { "Server", "Microsoft-IIS/6.0" }
@@ -1409,14 +1437,138 @@ const struct message responses[] =
}
#endif /* !HTTP_PARSER_STRICT */
#define AMAZON_COM 20
, {.name= "amazon.com"
,.type= HTTP_RESPONSE
,.raw= "HTTP/1.1 301 MovedPermanently\r\n"
"Date: Wed, 15 May 2013 17:06:33 GMT\r\n"
"Server: Server\r\n"
"x-amz-id-1: 0GPHKXSJQ826RK7GZEB2\r\n"
"p3p: policyref=\"http://www.amazon.com/w3c/p3p.xml\",CP=\"CAO DSP LAW CUR ADM IVAo IVDo CONo OTPo OUR DELi PUBi OTRi BUS PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA HEA PRE LOC GOV OTC \"\r\n"
"x-amz-id-2: STN69VZxIFSz9YJLbz1GDbxpbjG6Qjmmq5E3DxRhOUw+Et0p4hr7c/Q8qNcx4oAD\r\n"
"Location: http://www.amazon.com/Dan-Brown/e/B000AP9DSU/ref=s9_pop_gw_al1?_encoding=UTF8&refinementId=618073011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-2&pf_rd_r=0SHYY5BZXN3KR20BNFAY&pf_rd_t=101&pf_rd_p=1263340922&pf_rd_i=507846\r\n"
"Vary: Accept-Encoding,User-Agent\r\n"
"Content-Type: text/html; charset=ISO-8859-1\r\n"
"Transfer-Encoding: chunked\r\n"
"\r\n"
"1\r\n"
"\n\r\n"
"0\r\n"
"\r\n"
,.should_keep_alive= TRUE
,.message_complete_on_eof= FALSE
,.http_major= 1
,.http_minor= 1
,.status_code= 301
,.response_status= "MovedPermanently"
,.num_headers= 9
,.headers= { { "Date", "Wed, 15 May 2013 17:06:33 GMT" }
, { "Server", "Server" }
, { "x-amz-id-1", "0GPHKXSJQ826RK7GZEB2" }
, { "p3p", "policyref=\"http://www.amazon.com/w3c/p3p.xml\",CP=\"CAO DSP LAW CUR ADM IVAo IVDo CONo OTPo OUR DELi PUBi OTRi BUS PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA HEA PRE LOC GOV OTC \"" }
, { "x-amz-id-2", "STN69VZxIFSz9YJLbz1GDbxpbjG6Qjmmq5E3DxRhOUw+Et0p4hr7c/Q8qNcx4oAD" }
, { "Location", "http://www.amazon.com/Dan-Brown/e/B000AP9DSU/ref=s9_pop_gw_al1?_encoding=UTF8&refinementId=618073011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-2&pf_rd_r=0SHYY5BZXN3KR20BNFAY&pf_rd_t=101&pf_rd_p=1263340922&pf_rd_i=507846" }
, { "Vary", "Accept-Encoding,User-Agent" }
, { "Content-Type", "text/html; charset=ISO-8859-1" }
, { "Transfer-Encoding", "chunked" }
}
,.body= "\n"
}
#define EMPTY_REASON_PHRASE_AFTER_SPACE 20
, {.name= "empty reason phrase after space"
,.type= HTTP_RESPONSE
,.raw= "HTTP/1.1 200 \r\n"
"\r\n"
,.should_keep_alive= FALSE
,.message_complete_on_eof= TRUE
,.http_major= 1
,.http_minor= 1
,.status_code= 200
,.response_status= ""
,.num_headers= 0
,.headers= {}
,.body= ""
}
, {.name= NULL } /* sentinel */
};
/* strnlen() is a POSIX.2008 addition. Can't rely on it being available so
* define it ourselves.
*/
size_t
strnlen(const char *s, size_t maxlen)
{
const char *p;
p = memchr(s, '\0', maxlen);
if (p == NULL)
return maxlen;
return p - s;
}
size_t
strlncat(char *dst, size_t len, const char *src, size_t n)
{
size_t slen;
size_t dlen;
size_t rlen;
size_t ncpy;
slen = strnlen(src, n);
dlen = strnlen(dst, len);
if (dlen < len) {
rlen = len - dlen;
ncpy = slen < rlen ? slen : (rlen - 1);
memcpy(dst + dlen, src, ncpy);
dst[dlen + ncpy] = '\0';
}
assert(len > slen + dlen);
return slen + dlen;
}
size_t
strlcat(char *dst, const char *src, size_t len)
{
return strlncat(dst, len, src, (size_t) -1);
}
size_t
strlncpy(char *dst, size_t len, const char *src, size_t n)
{
size_t slen;
size_t ncpy;
slen = strnlen(src, n);
if (len > 0) {
ncpy = slen < len ? slen : (len - 1);
memcpy(dst, src, ncpy);
dst[ncpy] = '\0';
}
assert(len > slen);
return slen;
}
size_t
strlcpy(char *dst, const char *src, size_t len)
{
return strlncpy(dst, len, src, (size_t) -1);
}
int
request_url_cb (http_parser *p, const char *buf, size_t len)
{
assert(p == parser);
strncat(messages[num_messages].request_url, buf, len);
strlncat(messages[num_messages].request_url,
sizeof(messages[num_messages].request_url),
buf,
len);
return 0;
}
@@ -1429,7 +1581,10 @@ header_field_cb (http_parser *p, const char *buf, size_t len)
if (m->last_header_element != FIELD)
m->num_headers++;
strncat(m->headers[m->num_headers-1][0], buf, len);
strlncat(m->headers[m->num_headers-1][0],
sizeof(m->headers[m->num_headers-1][0]),
buf,
len);
m->last_header_element = FIELD;
@@ -1442,19 +1597,39 @@ header_value_cb (http_parser *p, const char *buf, size_t len)
assert(p == parser);
struct message *m = &messages[num_messages];
strncat(m->headers[m->num_headers-1][1], buf, len);
strlncat(m->headers[m->num_headers-1][1],
sizeof(m->headers[m->num_headers-1][1]),
buf,
len);
m->last_header_element = VALUE;
return 0;
}
void
check_body_is_final (const http_parser *p)
{
if (messages[num_messages].body_is_final) {
fprintf(stderr, "\n\n *** Error http_body_is_final() should return 1 "
"on last on_body callback call "
"but it doesn't! ***\n\n");
assert(0);
abort();
}
messages[num_messages].body_is_final = http_body_is_final(p);
}
int
body_cb (http_parser *p, const char *buf, size_t len)
{
assert(p == parser);
strncat(messages[num_messages].body, buf, len);
strlncat(messages[num_messages].body,
sizeof(messages[num_messages].body),
buf,
len);
messages[num_messages].body_size += len;
check_body_is_final(p);
// printf("body_cb: '%s'\n", requests[num_messages].body);
return 0;
}
@@ -1465,6 +1640,7 @@ count_body_cb (http_parser *p, const char *buf, size_t len)
assert(p == parser);
assert(buf);
messages[num_messages].body_size += len;
check_body_is_final(p);
return 0;
}
@@ -1501,6 +1677,18 @@ message_complete_cb (http_parser *p)
assert(0);
abort();
}
if (messages[num_messages].body_size &&
http_body_is_final(p) &&
!messages[num_messages].body_is_final)
{
fprintf(stderr, "\n\n *** Error http_body_is_final() should return 1 "
"on last on_body callback call "
"but it doesn't! ***\n\n");
assert(0);
abort();
}
messages[num_messages].message_complete_cb_called = TRUE;
messages[num_messages].message_complete_on_eof = currently_parsing_eof;
@@ -1509,6 +1697,17 @@ message_complete_cb (http_parser *p)
return 0;
}
int
response_status_cb (http_parser *p, const char *buf, size_t len)
{
assert(p == parser);
strlncat(messages[num_messages].response_status,
sizeof(messages[num_messages].response_status),
buf,
len);
return 0;
}
/* These dontcall_* callbacks exist so that we can verify that when we're
* paused, no additional callbacks are invoked */
int
@@ -1569,11 +1768,20 @@ dontcall_message_complete_cb (http_parser *p)
abort();
}
int
dontcall_response_status_cb (http_parser *p, const char *buf, size_t len)
{
if (p || buf || len) { } // gcc
fprintf(stderr, "\n\n*** on_status() called on paused parser ***\n\n");
abort();
}
static http_parser_settings settings_dontcall =
{.on_message_begin = dontcall_message_begin_cb
,.on_header_field = dontcall_header_field_cb
,.on_header_value = dontcall_header_value_cb
,.on_url = dontcall_request_url_cb
,.on_status = dontcall_response_status_cb
,.on_body = dontcall_body_cb
,.on_headers_complete = dontcall_headers_complete_cb
,.on_message_complete = dontcall_message_complete_cb
@@ -1639,11 +1847,20 @@ pause_message_complete_cb (http_parser *p)
return message_complete_cb(p);
}
int
pause_response_status_cb (http_parser *p, const char *buf, size_t len)
{
http_parser_pause(p, 1);
*current_pause_parser = settings_dontcall;
return response_status_cb(p, buf, len);
}
static http_parser_settings settings_pause =
{.on_message_begin = pause_message_begin_cb
,.on_header_field = pause_header_field_cb
,.on_header_value = pause_header_value_cb
,.on_url = pause_request_url_cb
,.on_status = pause_response_status_cb
,.on_body = pause_body_cb
,.on_headers_complete = pause_headers_complete_cb
,.on_message_complete = pause_message_complete_cb
@@ -1654,6 +1871,7 @@ static http_parser_settings settings =
,.on_header_field = header_field_cb
,.on_header_value = header_value_cb
,.on_url = request_url_cb
,.on_status = response_status_cb
,.on_body = body_cb
,.on_headers_complete = headers_complete_cb
,.on_message_complete = message_complete_cb
@@ -1664,6 +1882,7 @@ static http_parser_settings settings_count_body =
,.on_header_field = header_field_cb
,.on_header_value = header_value_cb
,.on_url = request_url_cb
,.on_status = response_status_cb
,.on_body = count_body_cb
,.on_headers_complete = headers_complete_cb
,.on_message_complete = message_complete_cb
@@ -1674,6 +1893,7 @@ static http_parser_settings settings_null =
,.on_header_field = 0
,.on_header_value = 0
,.on_url = 0
,.on_status = 0
,.on_body = 0
,.on_headers_complete = 0
,.on_message_complete = 0
@@ -1797,6 +2017,7 @@ message_eq (int index, const struct message *expected)
MESSAGE_CHECK_NUM_EQ(expected, m, method);
} else {
MESSAGE_CHECK_NUM_EQ(expected, m, status_code);
MESSAGE_CHECK_STR_EQ(expected, m, response_status);
}
MESSAGE_CHECK_NUM_EQ(expected, m, should_keep_alive);
@@ -1926,8 +2147,7 @@ upgrade_message_fix(char *body, const size_t nread, const size_t nmsgs, ...) {
static void
print_error (const char *raw, size_t error_location)
{
fprintf(stderr, "\n*** %s:%d -- %s ***\n\n",
"http_parser.c", HTTP_PARSER_ERRNO_LINE(parser),
fprintf(stderr, "\n*** %s ***\n\n",
http_errno_description(HTTP_PARSER_ERRNO(parser)));
int this_line = 0, char_len = 0;
@@ -2108,6 +2328,25 @@ const struct url_test url_tests[] =
,.rv=0
}
, {.name="ipv4 in ipv6 address"
,.url="http://[2001:0000:0000:0000:0000:0000:1.9.1.1]/"
,.is_connect=0
,.u=
{.field_set=(1 << UF_SCHEMA) | (1 << UF_HOST) | (1 << UF_PATH)
,.port=0
,.field_data=
{{ 0, 4 } /* UF_SCHEMA */
,{ 8, 37 } /* UF_HOST */
,{ 0, 0 } /* UF_PORT */
,{ 46, 1 } /* UF_PATH */
,{ 0, 0 } /* UF_QUERY */
,{ 0, 0 } /* UF_FRAGMENT */
,{ 0, 0 } /* UF_USERINFO */
}
}
,.rv=0
}
, {.name="extra ? in query string"
,.url="http://a.tbcdn.cn/p/fp/2010c/??fp-header-min.css,fp-base-min.css,"
"fp-channel-min.css,fp-product-min.css,fp-mall-min.css,fp-category-min.css,"
@@ -2462,7 +2701,7 @@ dump_url (const char *url, const struct http_parser_url *u)
continue;
}
printf("\tfield_data[%u]: off: %u len: %u part: \"%.*s\n",
printf("\tfield_data[%u]: off: %u len: %u part: \"%.*s\n\"",
i,
u->field_data[i].off,
u->field_data[i].len,
@@ -2852,15 +3091,15 @@ test_scan (const struct message *r1, const struct message *r2, const struct mess
parser_init(type_both ? HTTP_BOTH : r1->type);
buf1_len = i;
strncpy(buf1, total, buf1_len);
strlncpy(buf1, sizeof(buf1), total, buf1_len);
buf1[buf1_len] = 0;
buf2_len = j - i;
strncpy(buf2, total+i, buf2_len);
strlncpy(buf2, sizeof(buf1), total+i, buf2_len);
buf2[buf2_len] = 0;
buf3_len = total_len - j;
strncpy(buf3, total+j, buf3_len);
strlncpy(buf3, sizeof(buf1), total+j, buf3_len);
buf3[buf3_len] = 0;
read = parse(buf1, buf1_len);
@@ -3024,6 +3263,16 @@ main (void)
int i, j, k;
int request_count;
int response_count;
unsigned long version;
unsigned major;
unsigned minor;
unsigned patch;
version = http_parser_version();
major = (version >> 16) & 255;
minor = (version >> 8) & 255;
patch = version & 255;
printf("http_parser v%u.%u.%u (0x%06lx)\n", major, minor, patch, version);
printf("sizeof(http_parser) = %u\n", (unsigned int)sizeof(http_parser));
@@ -3087,6 +3336,7 @@ main (void)
,.http_major= 1
,.http_minor= 0
,.status_code= 200
,.response_status= "OK"
,.num_headers= 2
,.headers=
{ { "Transfer-Encoding", "chunked" }

2
deps/npm/AUTHORS vendored
View File

@@ -113,3 +113,5 @@ Stuart Knightley <stuart@stuartk.com>
Stuart P. Bentley <stuart@testtrack4.com>
Vaz Allen <vaz@tryptid.com>
elisee <elisee@sparklin.org>
Evan You <yyx990803@gmail.com>
Wil Moore III <wil.moore@wilmoore.com>

View File

@@ -15,7 +15,7 @@ The username, password, and email are read in from prompts.
You may use this command to change your email address, but not username
or password.
To reset your password, go to <http://admin.npmjs.org/>
To reset your password, go to <https://npmjs.org/forgot>
You may use this command multiple times with the same user account to
authorize on a new machine.

View File

@@ -4,12 +4,14 @@ npm-bugs(1) -- Bugs for a package in a web browser maybe
## SYNOPSIS
npm bugs <pkgname>
npm bugs (with no args in a package dir)
## DESCRIPTION
This command tries to guess at the likely location of a package's
bug tracker URL, and then tries to open it using the `--browser`
config param.
config param. If no package name is provided, it will search for
a `package.json` in the current folder and use the `name` property.
## CONFIGURATION

View File

@@ -4,13 +4,16 @@ npm-docs(1) -- Docs for a package in a web browser maybe
## SYNOPSIS
npm docs <pkgname>
npm docs (with no args in a package dir)
npm home <pkgname>
npm home (with no args in a package dir)
## DESCRIPTION
This command tries to guess at the likely location of a package's
documentation URL, and then tries to open it using the `--browser`
config param.
config param. If no package name is provided, it will search for
a `package.json` in the current folder and use the `name` property.
## CONFIGURATION

View File

@@ -173,6 +173,9 @@ local space in some cases.
The `--no-bin-links` argument will prevent npm from creating symlinks for
any binaries the package might contain.
The `--no-optional` argument will prevent optional dependencies from
being installed.
The `--no-shrinkwrap` argument, which will ignore an available
shrinkwrap file and use the package.json instead.

View File

@@ -4,12 +4,14 @@ npm-repo(1) -- Open package repository page in the browser
## SYNOPSIS
npm repo <pkgname>
npm repo (with no args in a package dir)
## DESCRIPTION
This command tries to guess at the likely location of a package's
repository URL, and then tries to open it using the `--browser`
config param.
config param. If no package name is provided, it will search for
a `package.json` in the current folder and use the `name` property.
## CONFIGURATION

View File

@@ -3,7 +3,7 @@ npm-version(1) -- Bump a package version
## SYNOPSIS
npm version [<newversion> | major | minor | patch | build]
npm version [<newversion> | major | minor | patch]
## DESCRIPTION
@@ -11,7 +11,7 @@ Run this in a package directory to bump the version and write the new
data back to the package.json file.
The `newversion` argument should be a valid semver string, *or* a valid
second argument to semver.inc (one of "build", "patch", "minor", or
second argument to semver.inc (one of "patch", "minor", or
"major"). In the second case, the existing version will be incremented
by 1 in the specified field.

View File

@@ -9,32 +9,6 @@ file. It must be actual JSON, not just a JavaScript object literal.
A lot of the behavior described in this document is affected by the config
settings described in `npm-config(7)`.
## DEFAULT VALUES
npm will default some values based on package contents.
* `"scripts": {"start": "node server.js"}`
If there is a `server.js` file in the root of your package, then npm
will default the `start` command to `node server.js`.
* `"scripts":{"preinstall": "node-waf clean || true; node-waf configure build"}`
If there is a `wscript` file in the root of your package, npm will
default the `preinstall` command to compile using node-waf.
* `"scripts":{"preinstall": "node-gyp rebuild"}`
If there is a `binding.gyp` file in the root of your package, npm will
default the `preinstall` command to compile using node-gyp.
* `"contributors": [...]`
If there is an `AUTHORS` file in the root of your package, npm will
treat each line as a `Name <email> (url)` format, where email and url
are optional. Lines which start with a `#` or are blank, will be
ignored.
## name
The *most* important things in your package.json are the name and version fields.
@@ -112,21 +86,18 @@ If a url is provided, it will be used by the `npm bugs` command.
You should specify a license for your package so that people know how they are
permitted to use it, and any restrictions you're placing on it.
The simplest way, assuming you're using a common license such as BSD or MIT, is
to just specify the name of the license you're using, like this:
The simplest way, assuming you're using a common license such as BSD-3-Clause
or MIT, is to just specify the standard SPDX ID of the license you're using,
like this:
{ "license" : "BSD" }
{ "license" : "BSD-3-Clause" }
If you have more complex licensing terms, or you want to provide more detail
in your package.json file, you can use the more verbose plural form, like this:
You can check [the full list of SPDX license IDs](https://spdx.org/licenses/).
Ideally you should pick one that is
[OSI](http://opensource.org/licenses/alphabetical) approved.
"licenses" : [
{ "type" : "MyLicense"
, "url" : "http://github.com/owner/project/path/to/license"
}
]
It's also a good idea to include a license file at the top level in your package.
It's also a good idea to include a LICENSE file at the top level in
your package.
## people fields: author, contributors
@@ -570,6 +541,27 @@ Any config values can be overridden, but of course only "tag" and
See `npm-config(7)` to see the list of config options that can be
overridden.
## DEFAULT VALUES
npm will default some values based on package contents.
* `"scripts": {"start": "node server.js"}`
If there is a `server.js` file in the root of your package, then npm
will default the `start` command to `node server.js`.
* `"scripts":{"preinstall": "node-gyp rebuild"}`
If there is a `binding.gyp` file in the root of your package, npm will
default the `preinstall` command to compile using node-gyp.
* `"contributors": [...]`
If there is an `AUTHORS` file in the root of your package, npm will
treat each line as a `Name <email> (url)` format, where email and url
are optional. Lines which start with a `#` or are blank, will be
ignored.
## SEE ALSO
* semver(7)

View File

@@ -194,6 +194,13 @@ re-checking against the registry.
Note that no purging is done unless the `npm cache clean` command is
explicitly used, and that only GET requests use the cache.
### cert
* Default: `null`
* Type: String
A client certificate to pass when accessing the registry.
### color
* Default: true on Posix, false on Windows
@@ -202,14 +209,6 @@ explicitly used, and that only GET requests use the cache.
If false, never shows colors. If `"always"` then always shows colors.
If true, then only prints color codes for tty file descriptors.
### coverage
* Default: false
* Type: Boolean
A flag to tell test-harness to run with their coverage options enabled,
if they respond to the `npm_config_coverage` environment variable.
### depth
* Default: Infinity
@@ -243,6 +242,12 @@ set.
The command to run for `npm edit` or `npm config edit`.
### email
The email of the logged-in user.
Set by the `npm adduser` command. Should not be set explicitly.
### engine-strict
* Default: false
@@ -305,6 +310,13 @@ The command to use for git commands. If git is installed on the
computer, but is not in the `PATH`, then set this to the full path to
the git binary.
### git-tag-version
* Default: `true`
* Type: Boolean
Tag the commit when using the `npm version` command.
### global
* Default: false
@@ -326,17 +338,6 @@ Operates in "global" mode, so that packages are installed into the
The config file to read for global config options.
### globalignorefile
* Default: {prefix}/etc/npmignore
* Type: path
The config file to read for global ignore patterns to apply to all users
and all projects.
If not found, but there is a "gitignore" file in the
same directory, then that will be used instead.
### group
* Default: GID of the current process
@@ -345,6 +346,13 @@ same directory, then that will be used instead.
The group to use when running package scripts in global mode as the root
user.
### heading
* Default: `"npm"`
* Type: String
The string that starts all the debugging log output.
### https-proxy
* Default: the `HTTPS_PROXY` or `https_proxy` or `HTTP_PROXY` or
@@ -353,20 +361,12 @@ user.
A proxy to use for outgoing https requests.
### user-agent
### ignore-scripts
* Default: node/{process.version} {process.platform} {process.arch}
* Type: String
* Default: false
* Type: Boolean
Sets a User-Agent to the request header
### ignore
* Default: ""
* Type: string
A white-space separated list of glob patterns of files to always exclude
from packages when building tarballs.
If true, npm does not run scripts specified in package.json files.
### init-module
@@ -378,13 +378,6 @@ documentation for the
[init-package-json](https://github.com/isaacs/init-package-json) module
for more information, or npm-init(1).
### init.version
* Default: "0.0.0"
* Type: semver
The value `npm init` should use by default for the package version.
### init.author.name
* Default: ""
@@ -406,6 +399,13 @@ The value `npm init` should use by default for the package author's email.
The value `npm init` should use by default for the package author's homepage.
### init.license
* Default: "BSD-2-Clause"
* Type: String
The value `npm init` should use by default for the package license.
### json
* Default: false
@@ -417,6 +417,13 @@ This feature is currently experimental, and the output data structures
for many commands is either not implemented in JSON yet, or subject to
change. Only the output from `npm ls --json` is currently valid.
### key
* Default: `null`
* Type: String
A client key to pass when accessing the registry.
### link
* Default: false
@@ -433,6 +440,14 @@ if one of the two conditions are met:
* the globally installed version is identical to the version that is
being installed locally.
### local-address
* Default: undefined
* Type: IP Address
The IP address of the local interface to use when making connections
to the npm registry. Must be IPv4 in versions of Node prior to 0.12.
### loglevel
* Default: "http"
@@ -488,15 +503,7 @@ The node version to use when checking package's "engines" hash.
* Default: false
* Type: Boolean
Run tests on installation and report results to the
`npaturl`.
### npaturl
* Default: Not yet implemented
* Type: url
The url to report npat test results.
Run tests on installation.
### onload-script
@@ -756,16 +763,6 @@ The username on the npm registry. Set with `npm adduser`
The location of user-level configuration settings.
### userignorefile
* Default: ~/.npmignore
* Type: path
The location of a user-level ignore file to apply to all packages.
If not found, but there is a .gitignore file in the same directory, then
that will be used instead.
### umask
* Default: 022
@@ -778,6 +775,13 @@ Folders and executables are given a mode which is `0777` masked against
this value. Other files are given a mode which is `0666` masked against
this value. Thus, the defaults are `0755` and `0644` respectively.
### user-agent
* Default: node/{process.version} {process.platform} {process.arch}
* Type: String
Sets a User-Agent to the request header
### version
* Default: false
@@ -806,17 +810,6 @@ The program to use to view help content.
Set to `"browser"` to view html help content in the default web browser.
### yes
* Default: null
* Type: Boolean or null
If set to `null`, then prompt the user for responses in some
circumstances.
If set to `true`, then answer "yes" to any prompt. If set to `false`
then answer "no" to any prompt.
## SEE ALSO
* npm-config(1)

View File

@@ -277,6 +277,7 @@ Windows:
* <http://github.com/marcelklehr/nodist>
* <https://github.com/hakobera/nvmw>
* <https://github.com/nanjingboy/nvmw>
## How can I use npm for development?

View File

@@ -115,6 +115,10 @@ Publish a package
Rebuild a package
## npm-repo(1)
Open package repository page in the browser
## npm-restart(1)
Start a package
@@ -191,10 +195,6 @@ View registry info
Display npm username
## repo(1)
Open package repository page in the browser
# API Documentation
## npm(3)
@@ -285,6 +285,10 @@ Publish a package
Rebuild a package
## npm-repo(3)
Open package repository page in the browser
## npm-restart(3)
Start a package
@@ -349,10 +353,6 @@ View registry info
Display npm username
## repo(3)
Open package repository page in the browser
# Files
## npm-folders(5)

View File

@@ -239,7 +239,7 @@ will no doubt tell you to put the output in a gist or email.</p>
<ul><li><a href="cli/npm.html">npm(1)</a></li><li><a href="misc/npm-faq.html">npm-faq(7)</a></li><li><a href="cli/npm-help.html">npm-help(1)</a></li><li><a href="misc/npm-index.html">npm-index(7)</a></li></ul>
</div>
<p id="footer"><a href="../doc/README.html">README</a> &mdash; npm@1.3.15</p>
<p id="footer"><a href="../doc/README.html">README</a> &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -19,7 +19,7 @@
<p>This function should not be used programmatically. Instead, just refer
to the <code>npm.bin</code> member.</p>
</div>
<p id="footer">npm-bin &mdash; npm@1.3.15</p>
<p id="footer">npm-bin &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -25,7 +25,7 @@ optional version number.</p>
<p>This command will launch a browser, so this command may not be the most
friendly for programmatic use.</p>
</div>
<p id="footer">npm-bugs &mdash; npm@1.3.15</p>
<p id="footer">npm-bugs &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -28,7 +28,7 @@ usage, or <code>man 3 npm-&lt;command&gt;</code> for programmatic usage.</p>
<ul><li><a href="../misc/npm-index.html">npm-index(7)</a></li></ul>
</div>
<p id="footer">npm-commands &mdash; npm@1.3.15</p>
<p id="footer">npm-commands &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -33,7 +33,7 @@ functions instead.</p>
<ul><li><a href="../api/npm.html">npm(3)</a></li></ul>
</div>
<p id="footer">npm-config &mdash; npm@1.3.15</p>
<p id="footer">npm-config &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -32,7 +32,7 @@ install the package.</p></li></ul>
<ul><li><a href="../api/npm-publish.html">npm-publish(3)</a></li><li><a href="../api/npm-unpublish.html">npm-unpublish(3)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li></ul>
</div>
<p id="footer">npm-deprecate &mdash; npm@1.3.15</p>
<p id="footer">npm-deprecate &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -25,7 +25,7 @@ optional version number.</p>
<p>This command will launch a browser, so this command may not be the most
friendly for programmatic use.</p>
</div>
<p id="footer">npm-docs &mdash; npm@1.3.15</p>
<p id="footer">npm-docs &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -30,7 +30,7 @@ to open. The package can optionally have a version number attached.</p>
<p>Since this command opens an editor in a new process, be careful about where
and how this is used.</p>
</div>
<p id="footer">npm-edit &mdash; npm@1.3.15</p>
<p id="footer">npm-edit &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -24,7 +24,7 @@ sure to use <code>npm rebuild &lt;pkg&gt;</code> if you make any changes.</p>
<p>The first element in the &#39;args&#39; parameter must be a package name. After that is the optional command, which can be any number of strings. All of the strings will be combined into one, space-delimited command.</p>
</div>
<p id="footer">npm-explore &mdash; npm@1.3.15</p>
<p id="footer">npm-explore &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -32,7 +32,7 @@ Name of the file that matched</li></ul>
<p>The silent parameter is not neccessary not used, but it may in the future.</p>
</div>
<p id="footer">npm-help-search &mdash; npm@1.3.15</p>
<p id="footer">npm-help-search &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -35,7 +35,7 @@ then go ahead and use this programmatically.</p>
<p><a href="../files/package.json.html">package.json(5)</a></p>
</div>
<p id="footer">npm-init &mdash; npm@1.3.15</p>
<p id="footer">npm-init &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -25,7 +25,7 @@ the name of a package to be installed.</p>
<p>Finally, &#39;callback&#39; is a function that will be called when all packages have been
installed or when an error has been encountered.</p>
</div>
<p id="footer">npm-install &mdash; npm@1.3.15</p>
<p id="footer">npm-install &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -39,7 +39,7 @@ npm.commands.link(&#39;redis&#39;, cb) # link-install the package</code></pre>
<p>Now, any changes to the redis package will be reflected in
the package in the current working directory</p>
</div>
<p id="footer">npm-link &mdash; npm@1.3.15</p>
<p id="footer">npm-link &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -32,7 +32,7 @@ config object.</p>
<p>For a list of all the available command-line configs, see <code>npm help config</code></p>
</div>
<p id="footer">npm-load &mdash; npm@1.3.15</p>
<p id="footer">npm-load &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -59,7 +59,7 @@ project.</p>
This means that if a submodule a same dependency as a parent module, then the
dependency will only be output once.</p>
</div>
<p id="footer">npm-ls &mdash; npm@1.3.15</p>
<p id="footer">npm-ls &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -19,7 +19,7 @@ currently outdated.</p>
<p>If the &#39;packages&#39; parameter is left out, npm will check all packages.</p>
</div>
<p id="footer">npm-outdated &mdash; npm@1.3.15</p>
<p id="footer">npm-outdated &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -34,7 +34,7 @@ that is not implemented at this time.</p>
<ul><li><a href="../api/npm-publish.html">npm-publish(3)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li></ul>
</div>
<p id="footer">npm-owner &mdash; npm@1.3.15</p>
<p id="footer">npm-owner &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -25,7 +25,7 @@ overwritten the second time.</p>
<p>If no arguments are supplied, then npm packs the current package folder.</p>
</div>
<p id="footer">npm-pack &mdash; npm@1.3.15</p>
<p id="footer">npm-pack &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -21,7 +21,7 @@
<p>This function is not useful programmatically</p>
</div>
<p id="footer">npm-prefix &mdash; npm@1.3.15</p>
<p id="footer">npm-prefix &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -23,7 +23,7 @@
<p>Extraneous packages are packages that are not listed on the parent
package&#39;s dependencies list.</p>
</div>
<p id="footer">npm-prune &mdash; npm@1.3.15</p>
<p id="footer">npm-prune &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -32,7 +32,7 @@ the registry. Overwrites when the &quot;force&quot; environment variable is set
<ul><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-adduser.html">npm-adduser(1)</a></li><li><a href="../api/npm-owner.html">npm-owner(3)</a></li></ul>
</div>
<p id="footer">npm-publish &mdash; npm@1.3.15</p>
<p id="footer">npm-publish &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -22,7 +22,7 @@ the new binary. If no &#39;packages&#39; parameter is specify, every package wil
<p>See <code>npm help build</code></p>
</div>
<p id="footer">npm-rebuild &mdash; npm@1.3.15</p>
<p id="footer">npm-rebuild &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

59
deps/npm/html/doc/api/npm-repo.html vendored Normal file
View File

@@ -0,0 +1,59 @@
<!doctype html>
<html>
<title>npm-repo</title>
<meta http-equiv="content-type" value="text/html;utf-8">
<link rel="stylesheet" type="text/css" href="../../static/style.css">
<body>
<div id="wrapper">
<h1><a href="../api/npm-repo.html">npm-repo</a></h1> <p>Open package repository page in the browser</p>
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<pre><code>npm.commands.repo(package, callback)</code></pre>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<p>This command tries to guess at the likely location of a package&#39;s
repository URL, and then tries to open it using the <code>--browser</code>
config param.</p>
<p>Like other commands, the first parameter is an array. This command only
uses the first element, which is expected to be a package name with an
optional version number.</p>
<p>This command will launch a browser, so this command may not be the most
friendly for programmatic use.</p>
</div>
<p id="footer">npm-repo &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
.filter(function (el) {
return el.parentNode === wrapper
&& el.tagName.match(/H[1-6]/)
&& el.id
})
var l = 2
, toc = document.createElement("ul")
toc.innerHTML = els.map(function (el) {
var i = el.tagName.charAt(1)
, out = ""
while (i > l) {
out += "<ul>"
l ++
}
while (i < l) {
out += "</ul>"
l --
}
out += "<li><a href='#" + el.id + "'>" +
( el.innerText || el.text || el.innerHTML)
+ "</a>"
return out
}).join("\n")
toc.id = "toc"
document.body.appendChild(toc)
})()
</script>

View File

@@ -27,7 +27,7 @@ in the <code>packages</code> parameter.</p>
<ul><li><a href="../api/npm-start.html">npm-start(3)</a></li><li><a href="../api/npm-stop.html">npm-stop(3)</a></li></ul>
</div>
<p id="footer">npm-restart &mdash; npm@1.3.15</p>
<p id="footer">npm-restart &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -21,7 +21,7 @@
<p>This function is not useful programmatically.</p>
</div>
<p id="footer">npm-root &mdash; npm@1.3.15</p>
<p id="footer">npm-root &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -29,7 +29,7 @@ assumed to be the command to run. All other elements are ignored.</p>
<ul><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../api/npm-test.html">npm-test(3)</a></li><li><a href="../api/npm-start.html">npm-start(3)</a></li><li><a href="../api/npm-restart.html">npm-restart(3)</a></li><li><a href="../api/npm-stop.html">npm-stop(3)</a></li></ul>
</div>
<p id="footer">npm-run-script &mdash; npm@1.3.15</p>
<p id="footer">npm-run-script &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -32,7 +32,7 @@ excluded term (the &quot;searchexclude&quot; config). The search is case insensi
and doesn&#39;t try to read your mind (it doesn&#39;t do any verb tense matching or the
like).</p>
</div>
<p id="footer">npm-search &mdash; npm@1.3.15</p>
<p id="footer">npm-search &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -26,7 +26,7 @@ but the shrinkwrap file will still be written.</p>
<p>Finally, &#39;callback&#39; is a function that will be called when the shrinkwrap has
been saved.</p>
</div>
<p id="footer">npm-shrinkwrap &mdash; npm@1.3.15</p>
<p id="footer">npm-shrinkwrap &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -19,7 +19,7 @@
<p>npm can run tests on multiple packages. Just specify multiple packages
in the <code>packages</code> parameter.</p>
</div>
<p id="footer">npm-start &mdash; npm@1.3.15</p>
<p id="footer">npm-start &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -19,7 +19,7 @@
<p>npm can run stop on multiple packages. Just specify multiple packages
in the <code>packages</code> parameter.</p>
</div>
<p id="footer">npm-stop &mdash; npm@1.3.15</p>
<p id="footer">npm-stop &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -33,7 +33,7 @@ dependencies into the submodule folder.</p>
<ul><li>npm help json</li><li>git help submodule</li></ul>
</div>
<p id="footer">npm-submodule &mdash; npm@1.3.15</p>
<p id="footer">npm-submodule &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -29,7 +29,7 @@ parameter is missing or falsey (empty), the default froom the config will be
used. For more information about how to set this config, check
<code>man 3 npm-config</code> for programmatic usage or <code>man npm-config</code> for cli usage.</p>
</div>
<p id="footer">npm-tag &mdash; npm@1.3.15</p>
<p id="footer">npm-tag &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -22,7 +22,7 @@ true.</p>
<p>npm can run tests on multiple packages. Just specify multiple packages
in the <code>packages</code> parameter.</p>
</div>
<p id="footer">npm-test &mdash; npm@1.3.15</p>
<p id="footer">npm-test &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -22,7 +22,7 @@ the name of a package to be uninstalled.</p>
<p>Finally, &#39;callback&#39; is a function that will be called when all packages have been
uninstalled or when an error has been encountered.</p>
</div>
<p id="footer">npm-uninstall &mdash; npm@1.3.15</p>
<p id="footer">npm-uninstall &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -26,7 +26,7 @@ is what is meant.</p>
<p>If no version is specified, or if all versions are removed then
the root package entry is removed from the registry entirely.</p>
</div>
<p id="footer">npm-unpublish &mdash; npm@1.3.15</p>
<p id="footer">npm-unpublish &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -18,7 +18,7 @@
<p>The &#39;packages&#39; argument is an array of packages to update. The &#39;callback&#39; parameter will be called when done or when an error occurs.</p>
</div>
<p id="footer">npm-update &mdash; npm@1.3.15</p>
<p id="footer">npm-update &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -24,7 +24,7 @@ fail if the repo is not clean.</p>
parameter. The difference, however, is this function will fail if it does
not have exactly one element. The only element should be a version number.</p>
</div>
<p id="footer">npm-version &mdash; npm@1.3.15</p>
<p id="footer">npm-version &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -99,7 +99,7 @@ the field name.</p>
<p>corresponding to the list of fields selected.</p>
</div>
<p id="footer">npm-view &mdash; npm@1.3.15</p>
<p id="footer">npm-view &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -21,7 +21,7 @@
<p>This function is not useful programmatically</p>
</div>
<p id="footer">npm-whoami &mdash; npm@1.3.15</p>
<p id="footer">npm-whoami &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -24,7 +24,7 @@ npm.load([configObject], function (er, npm) {
<h2 id="VERSION">VERSION</h2>
<p>1.3.15</p>
<p>1.3.23</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
@@ -92,7 +92,7 @@ method names. Use the <code>npm.deref</code> method to find the real name.</p>
<pre><code>var cmd = npm.deref(&quot;unp&quot;) // cmd === &quot;unpublish&quot;</code></pre>
</div>
<p id="footer">npm &mdash; npm@1.3.15</p>
<p id="footer">npm &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -25,7 +25,7 @@ optional version number.</p>
<p>This command will launch a browser, so this command may not be the most
friendly for programmatic use.</p>
</div>
<p id="footer">repo &mdash; npm@1.3.15</p>
<p id="footer">repo &mdash; npm@1.3.22</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -22,7 +22,7 @@ save the credentials to the <code>.npmrc</code> file.</p>
<p>You may use this command to change your email address, but not username
or password.</p>
<p>To reset your password, go to <a href="http://admin.npmjs.org/">http://admin.npmjs.org/</a></p>
<p>To reset your password, go to <a href="https://npmjs.org/forgot">https://npmjs.org/forgot</a></p>
<p>You may use this command multiple times with the same user account to
authorize on a new machine.</p>
@@ -39,7 +39,7 @@ authorize on a new machine.</p>
<ul><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../cli/npm-owner.html">npm-owner(1)</a></li><li><a href="../cli/npm-whoami.html">npm-whoami(1)</a></li></ul>
</div>
<p id="footer">npm-adduser &mdash; npm@1.3.15</p>
<p id="footer">npm-adduser &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -20,7 +20,7 @@
<ul><li><a href="../cli/npm-prefix.html">npm-prefix(1)</a></li><li><a href="../cli/npm-root.html">npm-root(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
<p id="footer">npm-bin &mdash; npm@1.3.15</p>
<p id="footer">npm-bin &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -10,13 +10,15 @@
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<pre><code>npm bugs &lt;pkgname&gt;</code></pre>
<pre><code>npm bugs &lt;pkgname&gt;
npm bugs (with no args in a package dir)</code></pre>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<p>This command tries to guess at the likely location of a package&#39;s
bug tracker URL, and then tries to open it using the <code>--browser</code>
config param.</p>
config param. If no package name is provided, it will search for
a <code>package.json</code> in the current folder and use the <code>name</code> property.</p>
<h2 id="CONFIGURATION">CONFIGURATION</h2>
@@ -36,7 +38,7 @@ config param.</p>
<ul><li><a href="../cli/npm-docs.html">npm-docs(1)</a></li><li><a href="../cli/npm-view.html">npm-view(1)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li></ul>
</div>
<p id="footer">npm-bugs &mdash; npm@1.3.15</p>
<p id="footer">npm-bugs &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -25,7 +25,7 @@ A folder containing a <code>package.json</code> file in its root.</li></ul>
<ul><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-link.html">npm-link(1)</a></li><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li></ul>
</div>
<p id="footer">npm-build &mdash; npm@1.3.15</p>
<p id="footer">npm-build &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -20,7 +20,7 @@ install packages into the local space.</p>
<ul><li><a href="../cli/npm-install.html">npm-install(1)</a></li></ul>
</div>
<p id="footer">npm-bundle &mdash; npm@1.3.15</p>
<p id="footer">npm-bundle &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -66,7 +66,7 @@ they do not make an HTTP request to the registry.</p>
<ul><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../cli/npm-pack.html">npm-pack(1)</a></li></ul>
</div>
<p id="footer">npm-cache &mdash; npm@1.3.15</p>
<p id="footer">npm-cache &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -33,7 +33,7 @@ completions based on the arguments.</p>
<ul><li><a href="../misc/npm-developers.html">npm-developers(7)</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../cli/npm.html">npm(1)</a></li></ul>
</div>
<p id="footer">npm-completion &mdash; npm@1.3.15</p>
<p id="footer">npm-completion &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -73,7 +73,7 @@ global config.</p>
<ul><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../cli/npm.html">npm(1)</a></li></ul>
</div>
<p id="footer">npm-config &mdash; npm@1.3.15</p>
<p id="footer">npm-config &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -62,7 +62,7 @@ versions.</p>
<ul><li><a href="../cli/npm-ls.html">npm-ls(1)</a></li><li><a href="../cli/npm-update.html">npm-update(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li></ul>
</div>
<p id="footer">npm-dedupe &mdash; npm@1.3.15</p>
<p id="footer">npm-dedupe &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -31,7 +31,7 @@ something like this:</p>
<ul><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li></ul>
</div>
<p id="footer">npm-deprecate &mdash; npm@1.3.15</p>
<p id="footer">npm-deprecate &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -11,13 +11,16 @@
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<pre><code>npm docs &lt;pkgname&gt;
npm home &lt;pkgname&gt;</code></pre>
npm docs (with no args in a package dir)
npm home &lt;pkgname&gt;
npm home (with no args in a package dir)</code></pre>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<p>This command tries to guess at the likely location of a package&#39;s
documentation URL, and then tries to open it using the <code>--browser</code>
config param.</p>
config param. If no package name is provided, it will search for
a <code>package.json</code> in the current folder and use the <code>name</code> property.</p>
<h2 id="CONFIGURATION">CONFIGURATION</h2>
@@ -37,7 +40,7 @@ config param.</p>
<ul><li><a href="../cli/npm-view.html">npm-view(1)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li></ul>
</div>
<p id="footer">npm-docs &mdash; npm@1.3.15</p>
<p id="footer">npm-docs &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -37,7 +37,7 @@ or <code>&quot;notepad&quot;</code> on Windows.</li><li>Type: path</li></ul>
<ul><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-explore.html">npm-explore(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
<p id="footer">npm-edit &mdash; npm@1.3.15</p>
<p id="footer">npm-edit &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -40,7 +40,7 @@ Windows</li><li>Type: path</li></ul>
<ul><li><a href="../cli/npm-submodule.html">npm-submodule(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-edit.html">npm-edit(1)</a></li><li><a href="../cli/npm-rebuild.html">npm-rebuild(1)</a></li><li><a href="../cli/npm-build.html">npm-build(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li></ul>
</div>
<p id="footer">npm-explore &mdash; npm@1.3.15</p>
<p id="footer">npm-explore &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -38,7 +38,7 @@ where the terms were found in the documentation.</p>
<ul><li><a href="../cli/npm.html">npm(1)</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../cli/npm-help.html">npm-help(1)</a></li></ul>
</div>
<p id="footer">npm-help-search &mdash; npm@1.3.15</p>
<p id="footer">npm-help-search &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -36,7 +36,7 @@ matches are equivalent to specifying a topic name.</p>
<ul><li><a href="../cli/npm.html">npm(1)</a></li><li><a href="../../doc/README.html">README</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-help-search.html">npm-help-search(1)</a></li><li><a href="../misc/npm-index.html">npm-index(7)</a></li></ul>
</div>
<p id="footer">npm-help &mdash; npm@1.3.15</p>
<p id="footer">npm-help &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -29,7 +29,7 @@ without a really good reason to do so.</p>
<ul><li><a href="https://github.com/isaacs/init-package-json">https://github.com/isaacs/init-package-json</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-version.html">npm-version(1)</a></li></ul>
</div>
<p id="footer">npm-init &mdash; npm@1.3.15</p>
<p id="footer">npm-init &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -84,6 +84,9 @@ local space in some cases.</p>
<p>The <code>--no-bin-links</code> argument will prevent npm from creating symlinks for
any binaries the package might contain.</p>
<p>The <code>--no-optional</code> argument will prevent optional dependencies from
being installed.</p>
<p>The <code>--no-shrinkwrap</code> argument, which will ignore an available
shrinkwrap file and use the package.json instead.</p>
@@ -146,7 +149,7 @@ affects a real use-case, it will be investigated.</p>
<ul><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-update.html">npm-update(1)</a></li><li><a href="../cli/npm-link.html">npm-link(1)</a></li><li><a href="../cli/npm-rebuild.html">npm-rebuild(1)</a></li><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../cli/npm-build.html">npm-build(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-tag.html">npm-tag(1)</a></li><li><a href="../cli/npm-rm.html">npm-rm(1)</a></li><li><a href="../cli/npm-shrinkwrap.html">npm-shrinkwrap(1)</a></li></ul>
</div>
<p id="footer">npm-install &mdash; npm@1.3.15</p>
<p id="footer">npm-install &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -62,7 +62,7 @@ installation target into your project&#39;s <code>node_modules</code> folder.</p
<ul><li><a href="../misc/npm-developers.html">npm-developers(7)</a></li><li><a href="../misc/npm-faq.html">npm-faq(7)</a></li><li><a href="../files/package.json.html">package.json(5)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
<p id="footer">npm-link &mdash; npm@1.3.15</p>
<p id="footer">npm-link &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -25,7 +25,7 @@ limit the results to only the paths to the packages named. Note that
nested packages will <em>also</em> show the paths to the specified packages.
For example, running <code>npm ls promzard</code> in npm&#39;s source tree will show:</p>
<pre><code>npm@1.3.15 /path/to/npm
<pre><code>npm@1.3.23 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5</code></pre>
@@ -68,7 +68,7 @@ project.</p>
<ul><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../cli/npm-link.html">npm-link(1)</a></li><li><a href="../cli/npm-prune.html">npm-prune(1)</a></li><li><a href="../cli/npm-outdated.html">npm-outdated(1)</a></li><li><a href="../cli/npm-update.html">npm-update(1)</a></li></ul>
</div>
<p id="footer">npm-ls &mdash; npm@1.3.15</p>
<p id="footer">npm-ls &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -25,7 +25,7 @@ version of the package.</p>
<ul><li><a href="../cli/npm-update.html">npm-update(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li></ul>
</div>
<p id="footer">npm-outdated &mdash; npm@1.3.15</p>
<p id="footer">npm-outdated &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -34,7 +34,7 @@ that is not implemented at this time.</p>
<ul><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-adduser.html">npm-adduser(1)</a></li><li><a href="../misc/npm-disputes.html">npm-disputes(7)</a></li></ul>
</div>
<p id="footer">npm-owner &mdash; npm@1.3.15</p>
<p id="footer">npm-owner &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -29,7 +29,7 @@ overwritten the second time.</p>
<ul><li><a href="../cli/npm-cache.html">npm-cache(1)</a></li><li><a href="../cli/npm-publish.html">npm-publish(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
<p id="footer">npm-pack &mdash; npm@1.3.15</p>
<p id="footer">npm-pack &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -20,7 +20,7 @@
<ul><li><a href="../cli/npm-root.html">npm-root(1)</a></li><li><a href="../cli/npm-bin.html">npm-bin(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
<p id="footer">npm-prefix &mdash; npm@1.3.15</p>
<p id="footer">npm-prefix &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -29,7 +29,7 @@ packages specified in your <code>devDependencies</code>.</p>
<ul><li><a href="../cli/npm-rm.html">npm-rm(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-ls.html">npm-ls(1)</a></li></ul>
</div>
<p id="footer">npm-prune &mdash; npm@1.3.15</p>
<p id="footer">npm-prune &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -29,7 +29,7 @@ the registry. Overwrites when the &quot;--force&quot; flag is set.</p>
<ul><li><a href="../misc/npm-registry.html">npm-registry(7)</a></li><li><a href="../cli/npm-adduser.html">npm-adduser(1)</a></li><li><a href="../cli/npm-owner.html">npm-owner(1)</a></li><li><a href="../cli/npm-deprecate.html">npm-deprecate(1)</a></li><li><a href="../cli/npm-tag.html">npm-tag(1)</a></li></ul>
</div>
<p id="footer">npm-publish &mdash; npm@1.3.15</p>
<p id="footer">npm-publish &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -26,7 +26,7 @@ the new binary.</p>
<ul><li><a href="../cli/npm-build.html">npm-build(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li></ul>
</div>
<p id="footer">npm-rebuild &mdash; npm@1.3.15</p>
<p id="footer">npm-rebuild &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

66
deps/npm/html/doc/cli/npm-repo.html vendored Normal file
View File

@@ -0,0 +1,66 @@
<!doctype html>
<html>
<title>npm-repo</title>
<meta http-equiv="content-type" value="text/html;utf-8">
<link rel="stylesheet" type="text/css" href="../../static/style.css">
<body>
<div id="wrapper">
<h1><a href="../cli/npm-repo.html">npm-repo</a></h1> <p>Open package repository page in the browser</p>
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<pre><code>npm repo &lt;pkgname&gt;
npm repo (with no args in a package dir)</code></pre>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<p>This command tries to guess at the likely location of a package&#39;s
repository URL, and then tries to open it using the <code>--browser</code>
config param. If no package name is provided, it will search for
a <code>package.json</code> in the current folder and use the <code>name</code> property.</p>
<h2 id="CONFIGURATION">CONFIGURATION</h2>
<h3 id="browser">browser</h3>
<ul><li>Default: OS X: <code>&quot;open&quot;</code>, Windows: <code>&quot;start&quot;</code>, Others: <code>&quot;xdg-open&quot;</code></li><li>Type: String</li></ul>
<p>The browser that is called by the <code>npm repo</code> command to open websites.</p>
<h2 id="SEE-ALSO">SEE ALSO</h2>
<ul><li><a href="../cli/npm-docs.html">npm-docs(1)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li></ul>
</div>
<p id="footer">npm-repo &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
.filter(function (el) {
return el.parentNode === wrapper
&& el.tagName.match(/H[1-6]/)
&& el.id
})
var l = 2
, toc = document.createElement("ul")
toc.innerHTML = els.map(function (el) {
var i = el.tagName.charAt(1)
, out = ""
while (i > l) {
out += "<ul>"
l ++
}
while (i < l) {
out += "</ul>"
l --
}
out += "<li><a href='#" + el.id + "'>" +
( el.innerText || el.text || el.innerHTML)
+ "</a>"
return out
}).join("\n")
toc.id = "toc"
document.body.appendChild(toc)
})()
</script>

View File

@@ -24,7 +24,7 @@ the &quot;start&quot; script.</p>
<ul><li><a href="../cli/npm-run-script.html">npm-run-script(1)</a></li><li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li><li><a href="../cli/npm-test.html">npm-test(1)</a></li><li><a href="../cli/npm-start.html">npm-start(1)</a></li><li><a href="../cli/npm-stop.html">npm-stop(1)</a></li></ul>
</div>
<p id="footer">npm-restart &mdash; npm@1.3.15</p>
<p id="footer">npm-restart &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -24,7 +24,7 @@ on its behalf.</p>
<ul><li><a href="../cli/npm-prune.html">npm-prune(1)</a></li><li><a href="../cli/npm-install.html">npm-install(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
<p id="footer">npm-rm &mdash; npm@1.3.15</p>
<p id="footer">npm-rm &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

View File

@@ -20,7 +20,7 @@
<ul><li><a href="../cli/npm-prefix.html">npm-prefix(1)</a></li><li><a href="../cli/npm-bin.html">npm-bin(1)</a></li><li><a href="../files/npm-folders.html">npm-folders(5)</a></li><li><a href="../cli/npm-config.html">npm-config(1)</a></li><li><a href="../misc/npm-config.html">npm-config(7)</a></li><li><a href="../files/npmrc.html">npmrc(5)</a></li></ul>
</div>
<p id="footer">npm-root &mdash; npm@1.3.15</p>
<p id="footer">npm-root &mdash; npm@1.3.23</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")

Some files were not shown because too many files have changed in this diff Show More