summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2013-04-27http: write buffers when chunked to embrace writevFedor Indutny
2013-04-27net: implement ._writev for .cork/uncork() supportFedor Indutny
Add Writev method to StreamWrap class for writing mixed array of strings and buffers. Expose this method for TCP class.
2013-04-27streams: introduce .cork/.uncork/._writevFedor Indutny
2013-04-27debugger: breakpoints in scripts not loaded yetMiroslav Bajtoš
When developer calls setBreakpoint with an unknown script name, we convert the script name into regular expression matching all paths ending with given name (name can be a relative path too). To create such breakpoint in V8, we use type `scriptRegEx` instead of `scriptId` for `setbreakpoint` request. To restore such breakpoint, we save the original script name send by the user. We use this original name to set (restore) breakpoint in the new child process.
2013-04-26debugger: `restart` with custom debug portMiroslav Bajtoš
Fixed a bug in debugger repl where `restart` command did not work when a custom debug port was specified via command-line option --port={number}. File test/simple/helper-debugger-repl.js was extracted from test/simple/test-debugger-repl.js
2013-04-26debugger: print port number when connecting to debuggeeMiroslav Bajtoš
To improve troubleshooting of debugger problems in the future, the debugger repl now prints the port it is connecting to.
2013-04-26debugger: `restart` with custom debug portMiroslav Bajtoš
Fixed a bug in debugger repl where `restart` command did not work when a custom debug port was specified via command-line option --port={number}. File test/simple/helper-debugger-repl.js was extracted from test/simple/test-debugger-repl.js
2013-04-22http: Don't try to destroy nonexistent socketsisaacs
Fixes #3740 In the case of pipelined requests, you can have a situation where the socket gets destroyed via one req/res object, but then trying to destroy *another* req/res on the same socket will cause it to call undefined.destroy(), since it was already removed from that message. Add a guard to OutgoingMessage.destroy and IncomingMessage.destroy to prevent this error.
2013-04-22http: Don't try to destroy nonexistent socketsisaacs
Fixes #3740 In the case of pipelined requests, you can have a situation where the socket gets destroyed via one req/res object, but then trying to destroy *another* req/res on the same socket will cause it to call undefined.destroy(), since it was already removed from that message. Add a guard to OutgoingMessage.destroy and IncomingMessage.destroy to prevent this error.
2013-04-21crypto: LazyTransform on properties, not methodsisaacs
It needs to apply the Transform class when the _readableState, _writableState, or _transformState properties are accessed, otherwise things like setEncoding and on('data') don't work properly. Also, the methods wrappers are no longer needed, since they're only problematic because they access the undefined properties.
2013-04-20cluster: clean up lib/cluster.jsBen Noordhuis
Clean up and DRY the cluster source code. Fix a few bugs while we're here: * Short-lived handles in long-lived worker processes were never reclaimed, resulting in resource leaks. * Handles in the master process are now closed when the last worker that holds a reference to them quits. Previously, they were only closed at cluster shutdown. * The cluster object no longer exposes functions/properties that are only valid in the 'other' process, e.g. cluster.fork() is no longer exported in worker processes. So much goodness and still manages to reduce the line count from 590 to 320.
2013-04-19lintisaacs
2013-04-19events: add EventEmitter.defaultMaxListenersBen Noordhuis
Class property that controls the maximum number of listeners for all instances of EventEmitter. Fixes #3014. Conflicts: lib/events.js
2013-04-19path: add path.isAbsolute(path)Ryan Doenges
An absolute path will always open the same location regardless of your current working directory. For posix, this just means path.charAt(0) === '/', but on Windows it's a little more complicated. Fixes joyent/node#5299.
2013-04-18Merge remote-tracking branch 'ry/v0.10'isaacs
2013-04-18assert: put info in err.message, not err.nameRyan Doenges
4716dc6 made assert.equal() and related functions work better by generating a better toString() from the expected, actual, and operator values passed to fail(). Unfortunately, this was accomplished by putting the generated message into the error's `name` property. When you passed in a custom error message, the error would put the custom error into `name` *and* `message`, resulting in helpful string representations like "AssertionError: Oh no: Oh no". This commit resolves that issue by storing the generated message in the `message` property while leaving the error's name alone and adding a regression test so that this doesn't pop back up later. Closes #5292.
2013-04-18Merge remote-tracking branch 'origin/v0.10'Ben Noordhuis
Conflicts: src/node_os.cc
2013-04-18dgram: fix no address bind()Ben Noordhuis
I broke dgram.Socket#bind(port, cb) almost a year ago in 332fea5a but it wasn't until today that someone complained and none of the tests caught it because they all either specify the address or omit the callback. Anyway, now it works again and does what you expect: it binds the socket to the "any" address ("0.0.0.0" for IPv4 and "::" for IPv6.)
2013-04-17http: split Client into _http_client.jsTimothy J Fontaine
2013-04-17http: move Server and ServerResponse outTimothy J Fontaine
2013-04-17http: move OutgoingMessage into it's own fileTimothy J Fontaine
2013-04-17http: move parsers into _http_common.jsTimothy J Fontaine
2013-04-17http: move IncomingMessage into its own fileTimothy J Fontaine
2013-04-17http: split Agent into its own fileTimothy J Fontaine
2013-04-12http: escape unsafe characters in request pathBen Noordhuis
Make http.request() and friends escape unsafe characters in the request path. That is, a request for '/foo bar' is now escaped as '/foo%20bar'. Before this commit, the path was used as-is in the request status line, creating an invalid HTTP request ("GET /foo bar HTTP/1.1"). Fixes #4381.
2013-04-12url: ~ is not actually an unwise charisaacs
2013-04-12url: Escape all unwise charactersisaacs
This makes node's http URL handling logic identical to Chrome's Re #5284
2013-04-12Merge branch 'v0.10'Fedor Indutny
Conflicts: ChangeLog deps/uv/src/version.c src/node.h src/node_crypto.cc src/node_crypto_bio.cc src/node_crypto_bio.h src/node_object_wrap.h src/node_version.h
2013-04-11stream: Fix unshift() race conditionsisaacs
Fix #5272 The consumption of a readable stream is a dance with 3 partners. 1. The specific stream Author (A) 2. The Stream Base class (B), and 3. The Consumer of the stream (C) When B calls the _read() method that A implements, it sets a 'reading' flag, so that parallel calls to _read() can be avoided. When A calls stream.push(), B knows that it's safe to start calling _read() again. If the consumer C is some kind of parser that wants in some cases to pass the source stream off to some other party, but not before "putting back" some bit of previously consumed data (as in the case of Node's websocket http upgrade implementation). So, stream.unshift() will generally *never* be called by A, but *only* called by C. Prior to this patch, stream.unshift() *also* unset the state.reading flag, meaning that C could indicate the end of a read, and B would dutifully fire off another _read() call to A. This is inappropriate. In the case of fs streams, and other variably-laggy streams that don't tolerate overlapped _read() calls, this causes big problems. Also, calling stream.shift() after the 'end' event did not raise any kind of error, but would cause very strange behavior indeed. Calling it after the EOF chunk was seen, but before the 'end' event was fired would also cause weird behavior, and could lead to data being lost, since it would not emit another 'readable' event. This change makes it so that: 1. stream.unshift() does *not* set state.reading = false 2. stream.unshift() is allowed up until the 'end' event. 3. unshifting onto a EOF-encountered and zero-length (but not yet end-emitted) stream will defer the 'end' event until the new data is consumed. 4. pushing onto a EOF-encountered stream is now an error. So, if you read(), you have that single tick to safely unshift() data back into the stream, even if the null chunk was pushed, and the length was 0.
2013-04-11lintisaacs
2013-04-11child_process: fix O(n*m) scan of cmd stringBen Noordhuis
Don't scan the whole string for a "NODE_" substring, just check that the string starts with the expected prefix. This is a reprise of dbbfbe7 but this time for the child_process module.
2013-04-11cluster: fix O(n*m) scan of cmd stringBen Noordhuis
Don't scan the whole string for a "NODE_CLUSTER_" substring, just check that the string starts with the expected prefix. The linear scan was causing a noticeable (but unsurprising) slowdown on messages with a large .cmd string property.
2013-04-10domain: change name for domain setupTrevor Norris
The name UsingDomains is misleading for a function that initializes domains for use.
2013-04-10net: fix socket.bytesWritten Buffers supportFedor Indutny
Buffer.byteLength() works only for string inputs. Thus, when connection has pending Buffer to write, it should just use it's length instead of throwing exception.
2013-04-08buffer: fix offset checksŁukasz Walukiewicz
Fixed offset checks in Buffer.readInt32LE() and Buffer.readInt32BE() functions.
2013-04-09stream: call write cb before finish eventisaacs
Since 049903e, an end callback could be called before a write callback if end() is called before the write is done. This patch resolves the issue. In collaboration with @gne Fixes felixge/node-formidable#209 Fixes #5215
2013-04-08http: Support write(data, 'hex')isaacs
We were assuming that any string can be concatenated safely to CRLF. However, for hex, base64, or binary encoded writes, this is not the case, and results in sending the incorrect response. An unusual edge case, but certainly a bug.
2013-04-08crypto: fix constructor call in crypto streamsAndreas Madsen
When using some stream method on a lazy crypto stream, the transform constructor wasn't called. This caused the internal state object to be undefined.
2013-04-08net: account encoding in .byteLengthFedor Indutny
2013-04-08net: fix buffer iteration in bytesWrittenFedor Indutny
2013-04-07tls: Re-enable check of CN-ID in cert verificationTobias Müllerleile
RFC 6125 explicitly states that a client "MUST NOT seek a match for a reference identifier of CN-ID if the presented identifiers include a DNS-ID, SRV-ID, URI-ID, or any application-specific identifier types supported by the client", but it MAY do so if none of the mentioned identifier types (but others) are present.
2013-04-05stream: unused variableRafael Garcia
2013-04-05stream: remove vestiges of previous _transform APIRafael Garcia
2013-04-05Merge remote-tracking branch 'ry/v0.10'isaacs
Conflicts: AUTHORS ChangeLog deps/v8/src/json-parser.h lib/crypto.js src/node_version.h
2013-04-03http: Remove legacy ECONNRESET workaround codeisaacs
Fix #5179
2013-04-03child_process: acknowledge sent handlesFedor Indutny
Fix race-condition when multiple handles are sent and SCM_RIGHTS messages are gets merged by OS by avoiding sending multiple handles at once! fix #4885
2013-04-03assert: Simplify AssertError creationisaacs
2013-04-02http client: Ensure socket cleanup on response endisaacs
If an http response has an 'end' handler that throws, then the socket will never be released back into the pool. Granted, we do NOT guarantee that throwing will never have adverse effects on Node internal state. Such a guarantee cannot be reasonably made in a shared-global mutable-state side-effecty language like JavaScript. However, in this case, it's a rather trivial patch to increase our resilience a little bit, so it seems like a win. There is no semantic change in this case, except that some event listeners are removed, and the `'free'` event is emitted on nextTick, so that you can schedule another request which will re-use the same socket. From the user's point of view, there should be no detectable difference. Closes #5107
2013-04-01tls: Destroy socket when encrypted side closesisaacs
The v0.8 Stream.pipe() method automatically destroyed the destination stream whenever the src stream closed. However, this caused a lot of problems, and was removed by popular demand. (Many userland modules still have a no-op destroy() method just because of this.) It was also very hazardous because this would be done even if { end: false } was passed in the pipe options. In v0.10, we decided that the 'close' event and destroy() method are application-specific, and pipe() doesn't automatically call destroy(). However, TLS actually depended (silently) on this behavior. So, in this case, we should just go ahead and destroy the thing when close happens. Closes #5145
2013-04-01querystring: Removing unnecessary bindingMitar
Binding of `http_parser` in querystring isn't used anywhere and should be removed.