+2014.05.01, Version 0.11.13 (Unstable), 99c9930ad626e2796af23def7cac19b65c608d18
+
+* v8: upgrade to 3.24.35.22
+
+* buffer: add compare and equals methods (Sean McArthur)
+
+* buffer: improve {read,write}{U}Int* methods (Nick Apperson)
+
+* buffer: return uint if MSB is 1 in readUInt32 (goussardg)
+
+* buffer: truncate buffer after string decode (Fedor Indutny)
+
+* child_process: fix assertion error in spawnSync (Shigeki Ohtsu)
+
+* crypto: fix memory leak in CipherBase::Final (Fedor Indutny)
+
+* crypto: improve error messages (Ingmar Runge)
+
+* crypto: move `createCredentials` to tls (Fedor Indutny)
+
+* crypto: work around OpenSSL oddness (Fedor Indutny)
+
+* dgram: introduce `reuseAddr` option (Fedor Indutny)
+
+* domain: don't crash on "throw null" (Alex Kocharin)
+
+* events: check if _events is an own property (Vladimir Kurchatkin)
+
+* fs: improve performance of all stat functions (James Pickard)
+
+* fs: return blksize on stats object (Trevor Norris)
+
+* http: add request.flush() method (Ben Noordhuis)
+
+* http: better client "protocol not supported" error (Nathan Rajlich)
+
+* http: use defaultAgent.protocol in protocol check (Nathan Rajlich)
+
+* main: Handle SIGINT properly. (Geir Hauge)
+
+* net: bind to `::` TCP address by default (Fedor Indutny)
+
+* readline: consider newlines for cursor position (Yazhong Liu)
+
+* stream: split `objectMode` for Duplex (Vladimir Kurchatkin)
+
+* tls: `getPeerCertificate(detailed)` (Fedor Indutny)
+
+* tls: do not call SNICallback unless present (Fedor Indutny)
+
+* tls: force readable/writable to `true` (Fedor Indutny)
+
+* tls: support OCSP on client and server (Fedor Indutny)
+
+* util: made util.isArray a direct alias for Array.isArray (Evan Carroll)
+
+
+2014.03.11, Version 0.11.12 (Unstable), 7d6b8db40f32e817ff145b7cfe6b3aec3179fba7
+
+* uv: Upgrade to v0.11.22 (Timothy J Fontaine)
+
+* buffer: allow toString to accept Infinity for end (Brian White)
+
+* child_process: add spawnSync/execSync (Bert Belder, Timothy J Fontaine)
+
+* cluster: handle bind errors on Windows (Alexis Campailla)
+
+* contextify: handle infinite recursion errors (Fedor Indutny)
+
+* crypto: allow custom generator for DiffieHellman (Brian White)
+
+* crypto: allow setting add'l authenticated data (Brian White)
+
+* crypto: fix CipherFinal return value check (Brian White)
+
+* crypto: make NewSessionDoneCb public (Fedor Indutny)
+
+* dgram: pass the bytes sent to the send callback (Timothy J Fontaine)
+
+* dns: validate arguments in resolver (Kenan Sulayman)
+
+* dns: verify argument is valid function in resolve (Kenan Sulayman)
+
+* http: avoid duplicate keys in writeHead (David Björklund)
+
+* net: add localPort to connect options (Timothy J Fontaine)
+
+* node: do not print SyntaxError hints to stderr (Fedor Indutny)
+
+* node: invoke `beforeExit` again if loop was active (Fedor Indutny)
+
+* node: make AsyncListenerInst field more explicit (Trevor Norris)
+
+* os: networkInterfaces include scopeid for ipv6 (Xidorn Quan)
+
+* process: allow changing `exitCode` in `on('exit')` (Fedor Indutny)
+
+* readline: fix `line` event, if input emit 'end' (Yazhong Liu)
+
+* src: add tracing.v8.on('gc') statistics hooks (Ben Noordhuis)
+
+* src: add v8.getHeapStatistics() function (Ben Noordhuis)
+
+* src: emit 'beforeExit' event on process object (Ben Noordhuis)
+
+* src: move AsyncListener from process to tracing (Trevor Norris)
+
+* tls: fix crash in SNICallback (Fedor Indutny)
+
+* tls: introduce asynchronous `newSession` (Fedor Indutny)
+
+* util: show meaningful values for boxed primitives (Nathan Rajlich)
+
+* vm: don't copy Proxy object from parent context (Ben Noordhuis)
+
+* windows: make stdout/sterr pipes blocking (Alexis Campailla)
+
+* zlib: add sync versions for convenience methods (Nikolai Vavilov)
+
+
+2014.01.29, Version 0.11.11 (Unstable), b46e77421581ea358e221a8a843d057c747f7e90
+
+* v8: Upgrade to 3.22.24.19
+
+* http_parser: Upgrade to 2.2.1
+
+* openssl: Upgrade to 1.0.1f
+
+* uv: Upgrade to 0.11.18
+
+* async-listener: revamp of subsystem (Trevor Norris)
+
+* node: do not ever close stdio (Fedor Indutny)
+
+* http: use writev on chunked encoding (Trevor Norris)
+
+* async_wrap/timers: remove Add/RemoveAsyncListener (Trevor Norris)
+
+* child_process: better error reporting for exec (Fedor Indutny)
+
+* crypto: add newline to cert and key if not present (Fedor Indutny)
+
+* crypto: clear error in GetPeerCertificate (Fedor Indutny)
+
+* crypto: honor default ciphers in client mode (Jacob Hoffman-Andrews)
+
+* crypto: introduce .setEngine(engine, [flags]) (Fedor Indutny)
+
+* crypto: support custom pbkdf2 digest methods (Ben Noordhuis)
+
+* domain: fix off-by-one in Domain.exit() (Ryan Graham)
+
+* http: concatenate duplicate headers by default (Alex Kocharin)
+
+* http: do not emit EOF non-readable socket (Fedor Indutny)
+
+* node: fix argument parsing with -p arg (Alexis Campailla)
+
+* path: improve POSIX path.join() performance (Jo Liss)
+
+* tls: emit `clientError` on early socket close (Fedor Indutny)
+
+* tls: introduce `.setMaxSendFragment(size)` (Fedor Indutny)
+
+* tls: make cert/pfx optional in tls.createServer() (Ben Noordhuis)
+
+* tls: process accumulated input (Fedor Indutny)
+
+* tls: show human-readable error messages (Ben Noordhuis)
+
+* util: handle escaped forward slashes correctly (Tom Gallacher)
+
+
+2013.12.31, Version 0.11.10 (Unstable), 66931791f06207d1cdfea5ec1529edf3c94026d3
+
+* 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)
+
+* v8: upgrade to 3.22.24.5 (Timothy J Fontaine)
+
+* buffer: remove warning when no encoding is passed (Trevor Norris)
+
+* build: make v8 use random seed for hash tables (Ben Noordhuis)
+
+* crypto: build with shared openssl without NPN (Ben Noordhuis)
+
+* crypto: update root certificates (Ben Noordhuis)
+
+* debugger: pass on v8 debug switches (Ben Noordhuis)
+
+* domain: use AsyncListener API (Trevor Norris)
+
+* fs: add recursive subdirectory support to fs.watch (Nick Simmons)
+
+* fs: make fs.watch() non-recursive by default (Ben Noordhuis)
+
+* http: cleanup freeSockets when socket destroyed (fengmk2)
+
+* http: force socket encoding to be null (isaacs)
+
+* http: make DELETE requests set `req.method` (Nathan Rajlich)
+
+* node: add AsyncListener support (Trevor Norris)
+
+* src: remove global HandleScope that hid memory leaks (Ben Noordhuis)
+
+* tls: add ECDH ciphers support (Erik Dubbelboer)
+
+* tls: do not default to 'localhost' servername (Fedor Indutny)
+
+* tls: more accurate wrapping of connecting socket (Fedor Indutny)
+
+
+2013.10.30, Version 0.11.8 (Unstable), f8d86e24f3463c36f7f3f4c3b3ec779e5b6201e1
+
+* uv: Upgrade to v0.11.14
+
+* v8: upgrade 3.21.18.3
+
+* assert: indicate if exception message is generated (Glen Mailer)
+
+* buffer: add buf.toArrayBuffer() API (Trevor Norris)
+
+* cluster: fix premature 'disconnect' event (Ben Noordhuis)
+
+* crypto: add SPKAC support (Jason Gerfen)
+
+* debugger: count space for line numbers correctly (Alex Kocharin)
+
+* debugger: make busy loops SIGUSR1-interruptible (Ben Noordhuis)
+
+* debugger: repeat last command (Alex Kocharin)
+
+* debugger: show current line, fix for #6150 (Alex Kocharin)
+
+* dgram: send() can accept strings (Trevor Norris)
+
+* dns: rename domain to hostname (Ben Noordhuis)
+
+* dns: set hostname property on error object (Ben Noordhuis)
+
+* dtrace, mdb_v8: support more string, frame types (Dave Pacheco)
+
+* http: add statusMessage (Patrik Stutz)
+
+* http: expose supported methods (Ben Noordhuis)
+
+* http: provide backpressure for pipeline flood (isaacs)
+
+* process: Add exitCode property (isaacs)
+
+* tls: socket.renegotiate(options, callback) (Fedor Indutny)
+
+* util: format as Error if instanceof Error (Rod Vagg)
+
+
+2013.08.21, Version 0.11.7 (Unstable), be52549bfa5311208b5fcdb3ba09210460fa9ceb
+
+* uv: upgrade to v0.11.13
+
+* v8: upgrade to 3.20.17
+
+* buffer: adhere to INSPECT_MAX_BYTES (Timothy J Fontaine)
+
+* buffer: fix regression for large buffer creation (Trevor Norris)
+
+* buffer: don't throw if slice length too long (Trevor Norris)
+
+* buffer: Buffer(buf) constructor copies into the proper buffer (Ben Noordhuis)
+
+* cli: remove --max-stack-size (Ben Noordhuis)
+
+* cli: unknown command line options are errors (Ben Noordhuis)
+
+* child_process: exec accept buffer as an encoding (Seth Fitzsimmons)
+
+* crypto: make randomBytes/pbkdf2 callbacks domain aware (Ben Noordhuis)
+
+* domain: deprecate domain.dispose(). (Forrest L Norvell)
+
+* fs: Expose birthtime on stat objects (isaacs)
+
+* http: Only send connection:keep-alive if necessary (isaacs)
+
+* repl: Catch syntax errors better (isaacs, Nathan Rajlich)
+
+* stream: change default highWaterMark for objectMode to 16 (Mathias Buus)
+
+* stream: make setEncoding/pause/resume chainable (Julian Gruber, isaacs)
+
+* util: pass opts to custom inspect functions (Timothy J Fontaine)
+
+* vm: rewritten to behave like Contextify (Domenic Denicola)
+
+
+2013.08.21, Version 0.11.6 (Unstable), 04018d4b3938fd30ba14822e79195e4af2be36f6
+
+* uv: Upgrade to v0.11.8
+
+* v8: upgrade v8 to 3.20.14.1
+
+* build: disable SSLv2 by default (Ben Noordhuis)
+
+* build: don't auto-destroy existing configuration (Ben Noordhuis)
+
+* crypto: add TLS 1.1 and 1.2 to secureProtocol list (Matthias Bartelmeß)
+
+* crypto: fix memory leak in randomBytes() error path (Ben Noordhuis)
+
+* dgram: don't call into js when send cb is omitted (Ben Noordhuis)
+
+* dgram: fix regression in string argument handling (Ben Noordhuis)
+
+* domains: performance improvements (Trevor Norris)
+
+* events: EventEmitter = require('events') (Jake Verbaten)
+
+* http: Add write()/end() callbacks (isaacs)
+
+* http: Consistent 'finish' event semantics (isaacs)
+
+* http: Prefer 'binary' over 'ascii' (isaacs)
+
+* http: Support legacy agent.addRequest API (isaacs)
+
+* http: Write hex/base64 chunks properly (isaacs)
+
+* http: add agent.maxFreeSockets option (isaacs)
+
+* http: provide access to raw headers/trailers (isaacs)
+
+* http: removed headers stay removed (James Halliday)
+
+* http,timers: improve callback performance (Ben Noordhuis)
+
+* net: family option in net.connect (Vsevolod Strukchinsky)
+
+* readline: pause stdin before turning off terminal raw mode (Daniel Chatfield)
+
+* smalloc: allow different external array types (Trevor Norris)
+
+* smalloc: expose ExternalArraySize (Trevor Norris)
+
+* stream: Short-circuit buffer pushes when flowing (isaacs)
+
+* tls: handle errors on socket before releasing it (Fedor Indutny)
+
+* util: fix isPrimitive check (Trevor Norris)
+
+* util: isObject should always return boolean (Trevor Norris)
+
+
+2013.08.06, Version 0.11.5 (Unstable), 6f92da2dd106b0c63fde563284f83e08e2a521b5
+
+* v8: upgrade to 3.20.11
+
+* uv: upgrade to v0.11.7
+
+* buffer: return offset for end of last write (Trevor Norris)
+
+* build: embed the mdb_v8.so into the binary (Timothy J Fontaine)
+
+* build: fix --without-ssl build (Ben Noordhuis)
+
+* child_process: add 'shell' option to .exec() (Ben Noordhuis)
+
+* dgram: report send errors to cb, don't pass bytes (Ben Noordhuis)
+
+* fs: write strings directly to disk (Trevor Norris)
+
+* https: fix default port (Koichi Kobayashi)
+
+* openssl: use asm for sha, md5, rmd (Fedor Indutny)
+
+* os: add mac address to networkInterfaces() output (Brian White)
+
+* smalloc: introduce smalloc module (Trevor Norris)
+
+* stream: Simplify flowing, passive data listening (streams3) (isaacs)
+
+* tls: asynchronous SNICallback (Fedor Indutny)
+
+* tls: share tls tickets key between cluster workers (Fedor Indutny)
+
+* util: don't throw on circular %j input to format() (Ben Noordhuis)
+
+
+2013.07.12, Version 0.11.4 (Unstable), b5b84197ed037918fd1a26e5cb87cce7c812ca55
+
+* npm: Upgrade to 1.3.4
+
+* v8: Upgrade to v3.20.2
+
+* c-ares: Upgrade to piscisaureus/cares@805d153
+
+* timers: setImmediate process full queue each turn (Ben Noordhuis)
+
+* http: Add agent.get/request methods (isaacs)
+
+* http: Proper KeepAlive behavior (isaacs)
+
+* configure: fix the --without-ssl option (Nathan Rajlich)
+
+* buffer: propagate originating parent (Trevor Norris)
+
+* tls_wrap: return Error not throw for missing cert (Timothy J Fontaine)
+
+* src: enable native v8 typed arrays (Ben Noordhuis)
+
+* stream: objectMode transform should allow falsey values (Jeff Barczewski)
+
+* slab_allocator: remove SlabAllocator (Trevor Norris)
+
+* crypto: fix memory leak in LoadPKCS12 (Fedor Indutny)
+
+* tls: export TLSSocket (Fedor Indutny)
+
+* zlib: allow changing of level and strategy (Brian White)
+
+* zlib: allow custom flush type for flush() (Brian White)
+
+
+2013.06.26, Version 0.11.3 (Unstable), 38c0c47bbe280ddc42054418091571e532d82a1e
+
+* uv: Upgrade to v0.11.5
+
+* c-ares: upgrade to 1.10.0
+
+* v8: upgrade to v3.19.13
+
+* punycode: update to v1.2.3 (Mathias Bynens)
+
+* debugger: break on uncaught exception (Miroslav Bajtos)
+
+* child_process: emit 'disconnect' asynchronously (Ben Noordhuis)
+
+* dtrace: enable uv's probes if enabled (Timothy J Fontaine)
+
+* dtrace: unify dtrace and systemtap interfaces (Timothy J Fontaine)
+
+* buffer: New API for backing data store (Trevor Norris)
+
+* buffer: return `this` in fill() for chainability (Brian White)
+
+* build: fix include order for building on windows (Timothy J Fontaine)
+
+* build: add android support (Linus Mårtensson)
+
+* readline: strip ctrl chars for prompt width calc (Krzysztof Chrapka)
+
+* tls: introduce TLSSocket based on tls_wrap binding (Fedor Indutny)
+
+* tls: add localAddress and localPort properties (Ben Noordhuis)
+
+* crypto: free excessive memory in NodeBIO (Fedor Indutny)
+
+* process: remove maxTickDepth (Trevor Norris)
+
+* timers: use uv_now instead of Date.now (Timothy J Fontaine)
+
+* util: Add debuglog, deprecate console lookalikes (isaacs)
+
+* module: use path.sep instead of a custom solution (Robert Kowalski)
+
+* http: don't escape request path, reject bad chars (Ben Noordhuis)
+
+* net: emit dns 'lookup' event before connect (Ben Noordhuis)
+
+* dns: add getServers and setServers (Timothy J Fontaine)
+
+
+2013.05.13, Version 0.11.2 (Unstable), 5d3dc0e4c3369dfb00b7b13e08936c2e652fa696
+
+* uv: Upgrade to 0.11.2
+
+* V8: Upgrade to 3.19.0
+
+* npm: Upgrade to 1.2.21
+
+* build: Makefile should respect configure --prefix (Timothy J Fontaine)
+
+* cluster: use round-robin load balancing (Ben Noordhuis)
+
+* debugger, cluster: each worker has new debug port (Miroslav Bajtoš)
+
+* debugger: `restart` with custom debug port (Miroslav Bajtoš)
+
+* debugger: breakpoints in scripts not loaded yet (Miroslav Bajtoš)
+
+* event: EventEmitter#setMaxListeners() returns this (Sam Roberts)
+
+* events: add EventEmitter.defaultMaxListeners (Ben Noordhuis)
+
+* install: Support $(PREFIX) install target directory prefix (Olof Johansson)
+
+* os: Include netmask in os.networkInterfaces() (Ben Kelly)
+
+* path: add path.isAbsolute(path) (Ryan Doenges)
+
+* stream: Guarantee ordering of 'finish' event (isaacs)
+
+* streams: introduce .cork/.uncork/._writev (Fedor Indutny)
+
+* vm: add support for timeout argument (Andrew Paprocki)
+
+
+2013.04.19, Version 0.11.1 (Unstable), 4babd2b46ebf9fbea2c9946af5cfae25a33b2b22
+
+* V8: upgrade to 3.18.0
+
+* uv: Upgrade to v0.11.1
+
+* http: split into multiple separate modules (Timothy J Fontaine)
+
+* http: escape unsafe characters in request path (Ben Noordhuis)
+
+* url: Escape all unwise characters (isaacs)
+
+* build: depend on v8 postmortem-metadata if enabled (Paddy Byers)
+
+* etw: update prototypes to match dtrace provider (Timothy J Fontaine)
+
+* buffer: change output of Buffer.prototype.toJSON() (David Braun)
+
+* dtrace: actually use the _handle.fd value (Timothy J Fontaine)
+
+* dtrace: pass more arguments to probes (Dave Pacheco)
+
+* build: allow building with dtrace on osx (Dave Pacheco)
+
+* zlib: allow passing options to convenience methods (Kyle Robinson Young)
+
+
+2013.03.28, Version 0.11.0 (Unstable), bce38b3d74e64fcb7d04a2dd551151da6168cdc5
+
+* V8: update to 3.17.13
+
+* os: use %SystemRoot% or %windir% in os.tmpdir() (Suwon Chae)
+
+* util: fix util.inspect() line width calculation (Marcin Kostrzewa)
+
+* buffer: remove _charsWritten (Trevor Norris)
+
+* fs: uv_[fl]stat now reports subsecond resolution (Timothy J Fontaine)
+
+* fs: Throw if error raised and missing callback (bnoordhuis)
+
+* tls: expose SSL_CTX_set_timeout via tls.createServer (Manav Rathi)
+
+* tls: remove harmful unnecessary bounds checking (Marcel Laverdet)
+
+* buffer: write ascii strings using WriteOneByte (Trevor Norris)
+
+* dtrace: fix generation of v8 constants on freebsd (Fedor Indutny)
+
+* dtrace: x64 ustack helper (Fedor Indutny)
+
+* readline: handle wide characters properly (Nao Iizuka)
+
+* repl: Use a domain to catch async errors safely (isaacs)
+
+* repl: emit 'reset' event when context is reset (Sami Samhuri)
+
+* util: custom `inspect()` method may return an Object (Nathan Rajlich)
+
+* console: `console.dir()` bypasses inspect() methods (Nathan Rajlich)
+
+
+ 2014.09.16, Version 0.10.32 (Stable)
+
+ * npm: Update to 1.4.28
+
+ * v8: fix a crash introduced by previous release (Fedor Indutny)
+
+ * configure: add --openssl-no-asm flag (Fedor Indutny)
+
+ * crypto: use domains for any callback-taking method (Chris Dickinson)
+
+ * http: do not send `0\r\n\r\n` in TE HEAD responses (Fedor Indutny)
+
+ * querystring: fix unescape override (Tristan Berger)
+
+ * url: Add support for RFC 3490 separators (Mathias Bynens)
+
+
+ 2014.08.19, Version 0.10.31 (Stable), 7fabdc23d843cb705d2d0739e7bbdaaf50aa3292
+
+ * v8: backport CVE-2013-6668
+
+ * openssl: Update to v1.0.1i
+
+ * npm: Update to v1.4.23
+
+ * cluster: disconnect should not be synchronous (Sam Roberts)
+
+ * fs: fix fs.readFileSync fd leak when get RangeError (Jackson Tian)
+
+ * stream: fix Readable.wrap objectMode falsy values (James Halliday)
+
+ * timers: fix timers with non-integer delay hanging. (Julien Gilli)
+
+
2014.07.31, Version 0.10.30 (Stable), bc0ff830aff1e016163d855e86ded5c98b0899e8
* uv: Upgrade to v0.10.28
# parse our options
parser = optparse.OptionParser()
-parser.add_option("--debug",
+# Options should be in alphabetical order but keep --prefix at the top,
+# that's arguably the one people will be looking for most.
+parser.add_option('--prefix',
+ action='store',
+ dest='prefix',
+ help='select the install prefix (defaults to /usr/local)')
+
+parser.add_option('--debug',
+ action='store_true',
+ dest='debug',
+ help='also build debug build')
+
+parser.add_option('--dest-cpu',
+ action='store',
+ dest='dest_cpu',
+ help='CPU architecture to build for. Valid values are: arm, ia32, x64')
+
+parser.add_option('--dest-os',
+ action='store',
+ dest='dest_os',
+ help='operating system to build for. Valid values are: '
+ 'win, mac, solaris, freebsd, openbsd, linux, android')
+
+parser.add_option('--gdb',
+ action='store_true',
+ dest='gdb',
+ help='add gdb support')
+
+parser.add_option('--ninja',
+ action='store_true',
+ dest='use_ninja',
+ help='generate files for the ninja build system')
+
+parser.add_option('--no-ifaddrs',
+ action='store_true',
+ dest='no_ifaddrs',
+ help='use on deprecated SunOS systems that do not support ifaddrs.h')
+
+parser.add_option("--fully-static",
action="store_true",
- dest="debug",
- help="Also build debug build")
-
-parser.add_option("--prefix",
- action="store",
- dest="prefix",
- help="Select the install prefix (defaults to /usr/local)")
-
-parser.add_option("--without-npm",
- action="store_true",
- dest="without_npm",
- help="Don\'t install the bundled npm package manager")
-
-parser.add_option("--without-ssl",
- action="store_true",
- dest="without_ssl",
- help="Build without SSL")
-
-parser.add_option("--without-snapshot",
- action="store_true",
- dest="without_snapshot",
- help="Build without snapshotting V8 libraries. You might want to set"
- " this for cross-compiling. [Default: False]")
-
-parser.add_option("--shared-v8",
- action="store_true",
- dest="shared_v8",
- help="Link to a shared V8 DLL instead of static linking")
-
-parser.add_option("--shared-v8-includes",
- action="store",
- dest="shared_v8_includes",
- help="Directory containing V8 header files")
-
-parser.add_option("--shared-v8-libpath",
- action="store",
- dest="shared_v8_libpath",
- help="A directory to search for the shared V8 DLL")
-
-parser.add_option("--shared-v8-libname",
- action="store",
- dest="shared_v8_libname",
- help="Alternative lib name to link to (default: 'v8')")
-
-parser.add_option("--shared-openssl",
- action="store_true",
- dest="shared_openssl",
- help="Link to a shared OpenSSl DLL instead of static linking")
-
-parser.add_option("--shared-openssl-includes",
- action="store",
- dest="shared_openssl_includes",
- help="Directory containing OpenSSL header files")
-
-parser.add_option("--shared-openssl-libpath",
- action="store",
- dest="shared_openssl_libpath",
- help="A directory to search for the shared OpenSSL DLLs")
-
-parser.add_option("--shared-openssl-libname",
- action="store",
- dest="shared_openssl_libname",
- help="Alternative lib name to link to (default: 'crypto,ssl')")
+ dest="fully_static",
+ help="Generate an executable without external dynamic libraries. This "
+ "will not work on OSX when using default compilation environment")
+ parser.add_option("--openssl-no-asm",
+ action="store_true",
+ dest="openssl_no_asm",
+ help="Do not build optimized assembly for OpenSSL")
+
# deprecated
-parser.add_option("--openssl-use-sys",
- action="store_true",
- dest="shared_openssl",
+parser.add_option('--openssl-includes',
+ action='store',
+ dest='shared_openssl_includes',
help=optparse.SUPPRESS_HELP)
# deprecated
--- /dev/null
- if (this.chunkedEncoding) {
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// 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.
+
+var assert = require('assert').ok;
+var Stream = require('stream');
+var timers = require('timers');
+var util = require('util');
+
+var common = require('_http_common');
+
+var CRLF = common.CRLF;
+var chunkExpression = common.chunkExpression;
+var debug = common.debug;
+
+
+var connectionExpression = /Connection/i;
+var transferEncodingExpression = /Transfer-Encoding/i;
+var closeExpression = /close/i;
+var contentLengthExpression = /Content-Length/i;
+var dateExpression = /Date/i;
+var expectExpression = /Expect/i;
+
+var automaticHeaders = {
+ connection: true,
+ 'content-length': true,
+ 'transfer-encoding': true,
+ date: true
+};
+
+
+var dateCache;
+function utcDate() {
+ if (!dateCache) {
+ var d = new Date();
+ dateCache = d.toUTCString();
+ timers.enroll(utcDate, 1000 - d.getMilliseconds());
+ timers._unrefActive(utcDate);
+ }
+ return dateCache;
+}
+utcDate._onTimeout = function() {
+ dateCache = undefined;
+};
+
+
+function OutgoingMessage() {
+ Stream.call(this);
+
+ this.output = [];
+ this.outputEncodings = [];
+ this.outputCallbacks = [];
+
+ this.writable = true;
+
+ this._last = false;
+ this.chunkedEncoding = false;
+ this.shouldKeepAlive = true;
+ this.useChunkedEncodingByDefault = true;
+ this.sendDate = false;
+ this._removedHeader = {};
+
+ this._hasBody = true;
+ this._trailer = '';
+
+ this.finished = false;
+ this._hangupClose = false;
+
+ this.socket = null;
+ this.connection = null;
+}
+util.inherits(OutgoingMessage, Stream);
+
+
+exports.OutgoingMessage = OutgoingMessage;
+
+
+OutgoingMessage.prototype.setTimeout = function(msecs, callback) {
+ if (callback)
+ this.on('timeout', callback);
+ if (!this.socket) {
+ this.once('socket', function(socket) {
+ socket.setTimeout(msecs);
+ });
+ } else
+ this.socket.setTimeout(msecs);
+};
+
+
+// It's possible that the socket will be destroyed, and removed from
+// any messages, before ever calling this. In that case, just skip
+// it, since something else is destroying this connection anyway.
+OutgoingMessage.prototype.destroy = function(error) {
+ if (this.socket)
+ this.socket.destroy(error);
+ else
+ this.once('socket', function(socket) {
+ socket.destroy(error);
+ });
+};
+
+
+// This abstract either writing directly to the socket or buffering it.
+OutgoingMessage.prototype._send = function(data, encoding, callback) {
+ // This is a shameful hack to get the headers and first body chunk onto
+ // the same packet. Future versions of Node are going to take care of
+ // this at a lower level and in a more general way.
+ if (!this._headerSent) {
+ if (util.isString(data) &&
+ encoding !== 'hex' &&
+ encoding !== 'base64') {
+ data = this._header + data;
+ } else {
+ this.output.unshift(this._header);
+ this.outputEncodings.unshift('binary');
+ this.outputCallbacks.unshift(null);
+ }
+ this._headerSent = true;
+ }
+ return this._writeRaw(data, encoding, callback);
+};
+
+
+OutgoingMessage.prototype._writeRaw = function(data, encoding, callback) {
+ if (util.isFunction(encoding)) {
+ callback = encoding;
+ encoding = null;
+ }
+
+ if (data.length === 0) {
+ if (util.isFunction(callback))
+ process.nextTick(callback);
+ return true;
+ }
+
+ if (this.connection &&
+ this.connection._httpMessage === this &&
+ this.connection.writable &&
+ !this.connection.destroyed) {
+ // There might be pending data in the this.output buffer.
+ while (this.output.length) {
+ if (!this.connection.writable) {
+ this._buffer(data, encoding, callback);
+ return false;
+ }
+ var c = this.output.shift();
+ var e = this.outputEncodings.shift();
+ var cb = this.outputCallbacks.shift();
+ this.connection.write(c, e, cb);
+ }
+
+ // Directly write to socket.
+ return this.connection.write(data, encoding, callback);
+ } else if (this.connection && this.connection.destroyed) {
+ // The socket was destroyed. If we're still trying to write to it,
+ // then we haven't gotten the 'close' event yet.
+ return false;
+ } else {
+ // buffer, as long as we're not destroyed.
+ this._buffer(data, encoding, callback);
+ return false;
+ }
+};
+
+
+OutgoingMessage.prototype._buffer = function(data, encoding, callback) {
+ this.output.push(data);
+ this.outputEncodings.push(encoding);
+ this.outputCallbacks.push(callback);
+ return false;
+};
+
+
+OutgoingMessage.prototype._storeHeader = function(firstLine, headers) {
+ // firstLine in the case of request is: 'GET /index.html HTTP/1.1\r\n'
+ // in the case of response it is: 'HTTP/1.1 200 OK\r\n'
+ var state = {
+ sentConnectionHeader: false,
+ sentContentLengthHeader: false,
+ sentTransferEncodingHeader: false,
+ sentDateHeader: false,
+ sentExpect: false,
+ messageHeader: firstLine
+ };
+
+ var field, value;
+
+ if (headers) {
+ var keys = Object.keys(headers);
+ var isArray = util.isArray(headers);
+ var field, value;
+
+ for (var i = 0, l = keys.length; i < l; i++) {
+ var key = keys[i];
+ if (isArray) {
+ field = headers[key][0];
+ value = headers[key][1];
+ } else {
+ field = key;
+ value = headers[key];
+ }
+
+ if (util.isArray(value)) {
+ for (var j = 0; j < value.length; j++) {
+ storeHeader(this, state, field, value[j]);
+ }
+ } else {
+ storeHeader(this, state, field, value);
+ }
+ }
+ }
+
+ // Date header
+ if (this.sendDate === true && state.sentDateHeader === false) {
+ state.messageHeader += 'Date: ' + utcDate() + CRLF;
+ }
+
+ // Force the connection to close when the response is a 204 No Content or
+ // a 304 Not Modified and the user has set a "Transfer-Encoding: chunked"
+ // header.
+ //
+ // RFC 2616 mandates that 204 and 304 responses MUST NOT have a body but
+ // node.js used to send out a zero chunk anyway to accommodate clients
+ // that don't have special handling for those responses.
+ //
+ // It was pointed out that this might confuse reverse proxies to the point
+ // of creating security liabilities, so suppress the zero chunk and force
+ // the connection to close.
+ var statusCode = this.statusCode;
+ if ((statusCode === 204 || statusCode === 304) &&
+ this.chunkedEncoding === true) {
+ debug(statusCode + ' response should not use chunked encoding,' +
+ ' closing connection.');
+ this.chunkedEncoding = false;
+ this.shouldKeepAlive = false;
+ }
+
+ // keep-alive logic
+ if (this._removedHeader.connection) {
+ this._last = true;
+ this.shouldKeepAlive = false;
+ } else if (state.sentConnectionHeader === false) {
+ var shouldSendKeepAlive = this.shouldKeepAlive &&
+ (state.sentContentLengthHeader ||
+ this.useChunkedEncodingByDefault ||
+ this.agent);
+ if (shouldSendKeepAlive) {
+ state.messageHeader += 'Connection: keep-alive\r\n';
+ } else {
+ this._last = true;
+ state.messageHeader += 'Connection: close\r\n';
+ }
+ }
+
+ if (state.sentContentLengthHeader === false &&
+ state.sentTransferEncodingHeader === false) {
+ if (this._hasBody && !this._removedHeader['transfer-encoding']) {
+ if (this.useChunkedEncodingByDefault) {
+ state.messageHeader += 'Transfer-Encoding: chunked\r\n';
+ this.chunkedEncoding = true;
+ } else {
+ this._last = true;
+ }
+ } else {
+ // Make sure we don't end the 0\r\n\r\n at the end of the message.
+ this.chunkedEncoding = false;
+ }
+ }
+
+ this._header = state.messageHeader + CRLF;
+ this._headerSent = false;
+
+ // wait until the first body chunk, or close(), is sent to flush,
+ // UNLESS we're sending Expect: 100-continue.
+ if (state.sentExpect) this._send('');
+};
+
+function storeHeader(self, state, field, value) {
+ // Protect against response splitting. The if statement is there to
+ // minimize the performance impact in the common case.
+ if (/[\r\n]/.test(value))
+ value = value.replace(/[\r\n]+[ \t]*/g, '');
+
+ state.messageHeader += field + ': ' + value + CRLF;
+
+ if (connectionExpression.test(field)) {
+ state.sentConnectionHeader = true;
+ if (closeExpression.test(value)) {
+ self._last = true;
+ } else {
+ self.shouldKeepAlive = true;
+ }
+
+ } else if (transferEncodingExpression.test(field)) {
+ state.sentTransferEncodingHeader = true;
+ if (chunkExpression.test(value)) self.chunkedEncoding = true;
+
+ } else if (contentLengthExpression.test(field)) {
+ state.sentContentLengthHeader = true;
+ } else if (dateExpression.test(field)) {
+ state.sentDateHeader = true;
+ } else if (expectExpression.test(field)) {
+ state.sentExpect = true;
+ }
+}
+
+
+OutgoingMessage.prototype.setHeader = function(name, value) {
+ if (arguments.length < 2) {
+ throw new Error('`name` and `value` are required for setHeader().');
+ }
+
+ if (this._header) {
+ throw new Error('Can\'t set headers after they are sent.');
+ }
+
+ var key = name.toLowerCase();
+ this._headers = this._headers || {};
+ this._headerNames = this._headerNames || {};
+ this._headers[key] = value;
+ this._headerNames[key] = name;
+
+ if (automaticHeaders[key]) {
+ this._removedHeader[key] = false;
+ }
+};
+
+
+OutgoingMessage.prototype.getHeader = function(name) {
+ if (arguments.length < 1) {
+ throw new Error('`name` is required for getHeader().');
+ }
+
+ if (!this._headers) return;
+
+ var key = name.toLowerCase();
+ return this._headers[key];
+};
+
+
+OutgoingMessage.prototype.removeHeader = function(name) {
+ if (arguments.length < 1) {
+ throw new Error('`name` is required for removeHeader().');
+ }
+
+ if (this._header) {
+ throw new Error('Can\'t remove headers after they are sent.');
+ }
+
+ var key = name.toLowerCase();
+
+ if (key === 'date')
+ this.sendDate = false;
+ else if (automaticHeaders[key])
+ this._removedHeader[key] = true;
+
+ if (this._headers) {
+ delete this._headers[key];
+ delete this._headerNames[key];
+ }
+};
+
+
+OutgoingMessage.prototype._renderHeaders = function() {
+ if (this._header) {
+ throw new Error('Can\'t render headers after they are sent to the client.');
+ }
+
+ if (!this._headers) return {};
+
+ var headers = {};
+ var keys = Object.keys(this._headers);
+ for (var i = 0, l = keys.length; i < l; i++) {
+ var key = keys[i];
+ headers[this._headerNames[key]] = this._headers[key];
+ }
+ return headers;
+};
+
+
+Object.defineProperty(OutgoingMessage.prototype, 'headersSent', {
+ configurable: true,
+ enumerable: true,
+ get: function() { return !!this._header; }
+});
+
+
+OutgoingMessage.prototype.write = function(chunk, encoding, callback) {
+ if (!this._header) {
+ this._implicitHeader();
+ }
+
+ if (!this._hasBody) {
+ debug('This type of response MUST NOT have a body. ' +
+ 'Ignoring write() calls.');
+ return true;
+ }
+
+ if (!util.isString(chunk) && !util.isBuffer(chunk)) {
+ throw new TypeError('first argument must be a string or Buffer');
+ }
+
+
+ // If we get an empty string or buffer, then just do nothing, and
+ // signal the user to keep writing.
+ if (chunk.length === 0) return true;
+
+ var len, ret;
+ if (this.chunkedEncoding) {
+ if (util.isString(chunk) &&
+ encoding !== 'hex' &&
+ encoding !== 'base64' &&
+ encoding !== 'binary') {
+ len = Buffer.byteLength(chunk, encoding);
+ chunk = len.toString(16) + CRLF + chunk + CRLF;
+ ret = this._send(chunk, encoding, callback);
+ } else {
+ // buffer, or a non-toString-friendly encoding
+ if (util.isString(chunk))
+ len = Buffer.byteLength(chunk, encoding);
+ else
+ len = chunk.length;
+
+ if (this.connection && !this.connection.corked) {
+ this.connection.cork();
+ var conn = this.connection;
+ process.nextTick(function connectionCork() {
+ if (conn)
+ conn.uncork();
+ });
+ }
+ this._send(len.toString(16), 'binary', null);
+ this._send(crlf_buf, null, null);
+ this._send(chunk, encoding, null);
+ ret = this._send(crlf_buf, null, callback);
+ }
+ } else {
+ ret = this._send(chunk, encoding, callback);
+ }
+
+ debug('write ret = ' + ret);
+ return ret;
+};
+
+
+OutgoingMessage.prototype.addTrailers = function(headers) {
+ this._trailer = '';
+ var keys = Object.keys(headers);
+ var isArray = util.isArray(headers);
+ var field, value;
+ for (var i = 0, l = keys.length; i < l; i++) {
+ var key = keys[i];
+ if (isArray) {
+ field = headers[key][0];
+ value = headers[key][1];
+ } else {
+ field = key;
+ value = headers[key];
+ }
+
+ this._trailer += field + ': ' + value + CRLF;
+ }
+};
+
+
+var crlf_buf = new Buffer('\r\n');
+
+
+OutgoingMessage.prototype.end = function(data, encoding, callback) {
+ if (util.isFunction(data)) {
+ callback = data;
+ data = null;
+ } else if (util.isFunction(encoding)) {
+ callback = encoding;
+ encoding = null;
+ }
+
+ if (data && !util.isString(data) && !util.isBuffer(data)) {
+ throw new TypeError('first argument must be a string or Buffer');
+ }
+
+ if (this.finished) {
+ return false;
+ }
+
+ var self = this;
+ function finish() {
+ self.emit('finish');
+ }
+
+ if (util.isFunction(callback))
+ this.once('finish', callback);
+
+
+ if (!this._header) {
+ this._implicitHeader();
+ }
+
+ if (data && !this._hasBody) {
+ debug('This type of response MUST NOT have a body. ' +
+ 'Ignoring data passed to end().');
+ data = null;
+ }
+
+ if (this.connection && data)
+ this.connection.cork();
+
+ var ret;
+ if (data) {
+ // Normal body write.
+ ret = this.write(data, encoding);
+ }
+
++ if (this._hasBody && this.chunkedEncoding) {
+ ret = this._send('0\r\n' + this._trailer + '\r\n', 'binary', finish);
+ } else {
+ // Force a flush, HACK.
+ ret = this._send('', 'binary', finish);
+ }
+
+ if (this.connection && data)
+ this.connection.uncork();
+
+ this.finished = true;
+
+ // There is the first message on the outgoing queue, and we've sent
+ // everything to the socket.
+ debug('outgoing message end.');
+ if (this.output.length === 0 && this.connection._httpMessage === this) {
+ this._finish();
+ }
+
+ return ret;
+};
+
+
+OutgoingMessage.prototype._finish = function() {
+ assert(this.connection);
+ this.emit('prefinish');
+};
+
+
+// This logic is probably a bit confusing. Let me explain a bit:
+//
+// In both HTTP servers and clients it is possible to queue up several
+// outgoing messages. This is easiest to imagine in the case of a client.
+// Take the following situation:
+//
+// req1 = client.request('GET', '/');
+// req2 = client.request('POST', '/');
+//
+// When the user does
+//
+// req2.write('hello world\n');
+//
+// it's possible that the first request has not been completely flushed to
+// the socket yet. Thus the outgoing messages need to be prepared to queue
+// up data internally before sending it on further to the socket's queue.
+//
+// This function, outgoingFlush(), is called by both the Server and Client
+// to attempt to flush any pending messages out to the socket.
+OutgoingMessage.prototype._flush = function() {
+ if (this.socket && this.socket.writable) {
+ var ret;
+ while (this.output.length) {
+ var data = this.output.shift();
+ var encoding = this.outputEncodings.shift();
+ var cb = this.outputCallbacks.shift();
+ ret = this.socket.write(data, encoding, cb);
+ }
+
+ if (this.finished) {
+ // This is a queue to the server or client to bring in the next this.
+ this._finish();
+ } else if (ret) {
+ // This is necessary to prevent https from breaking
+ this.emit('drain');
+ }
+ }
+};
+
+
+OutgoingMessage.prototype.flush = function() {
+ if (!this._header) {
+ // Force-flush the headers.
+ this._implicitHeader();
+ this._send('');
+ }
+};
len = maxKeys;
}
- var decode = decodeURIComponent;
++ var decode = QueryString.unescape;
+ if (options && typeof options.decodeURIComponent === 'function') {
+ decode = options.decodeURIComponent;
+ }
+
for (var i = 0; i < len; ++i) {
var x = qs[i].replace(regexp, '%20'),
idx = x.indexOf(eq),
assert.equal(0xa2, b[18]);
assert.equal(0xe6, b[19]);
+
+// Test custom decode
+function demoDecode(str) {
+ return str + str;
+}
+assert.deepEqual(
+ qs.parse('a=a&b=b&c=c', null, null, { decodeURIComponent: demoDecode }),
+ { aa: 'aa', bb: 'bb', cc: 'cc' });
+
+
+// Test custom encode
+function demoEncode(str) {
+ return str[0];
+}
+var obj = { aa: 'aa', bb: 'bb', cc: 'cc' };
+assert.equal(
+ qs.stringify(obj, null, null, { encodeURIComponent: demoEncode }),
+ 'a=a&b=b&c=c');
++
+ // test overriding .unescape
+ var prevUnescape = qs.unescape;
+ qs.unescape = function (str) {
+ return str.replace(/o/g, '_');
+ };
+ assert.deepEqual(qs.parse('foo=bor'), {f__: 'b_r'});
+ qs.unescape = prevUnescape;