Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: persist net.Socket options before connect #880

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -744,5 +744,8 @@ Giovanny Andres Gongora Granada <gioyik@gmail.com>
Jeffrey Jagoda <jeffrey.jagoda@gmail.com>
Kelsey Breseman <ifoundthemeaningoflife@gmail.com>
Peter Petrov <onestone@gmail.com>
Andrew Crites <acrites@mobiquityinc.com>
Marat Abdullin <dakota@brokenpipe.ru>
Dan Varga <dvarga@redhat.com>

# Generated by tools/update-authors.sh
12 changes: 6 additions & 6 deletions COLLABORATOR_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ $ git rebase --abort
Checkout proper target branch

```text
$ git checkout v1.x
$ git checkout master
```

Update the tree

```text
$ git fetch origin
$ git merge --ff-only origin/v1.x
$ git merge --ff-only origin/master
```

Apply external patches
Expand All @@ -138,21 +138,21 @@ $ curl -L https://github.com/iojs/io.js/pull/xxx.patch | git am --whitespace=fix
Check and re-review the changes

```text
$ git diff origin/v1.x
$ git diff origin/master
```

Check number of commits and commit messages

```text
$ git log origin/v1.x...v1.x
$ git log origin/master...master
```

If there are multiple commits that relate to the same feature or
one with a feature and separate with a test for that feature -
you'll need to squash them (or strictly speaking `fixup`).

```text
$ git rebase -i origin/v1.x
$ git rebase -i origin/master
```

This will open a screen like this (in the default shell editor):
Expand Down Expand Up @@ -210,7 +210,7 @@ line.
Time to push it:

```text
$ git push origin v1.x
$ git push origin master
```

### I just made a mistake
Expand Down
22 changes: 7 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,8 @@ $ git remote add upstream git://github.com/iojs/io.js.git

#### Which branch?

Now decide if you want your feature or bug fix to go into the master branch
or the stable branch. As a rule of thumb, bug fixes go into the stable branch
while new features go into the master branch.

The stable branch is effectively frozen; patches that change the io.js
API/ABI or affect the run-time behavior of applications get rejected. The
current stable branch is set as the default branch on GitHub.
For developing new features and bug fixes, the `master` branch should be pulled
and built upon.

#### Respect the stability index

Expand All @@ -49,7 +44,7 @@ The rules for the master branch are less strict; consult the

In a nutshell, modules are at varying levels of API stability. Bug fixes are
always welcome but API or behavioral changes to modules at stability level 3
and up are off-limits.
(Locked) are off-limits.

#### Dependencies

Expand All @@ -71,12 +66,9 @@ does not align with the project team.
Create a feature branch and start hacking:

```text
$ git checkout -b my-feature-branch -t origin/v1.x
$ git checkout -b my-feature-branch -t origin/master
```

(Where `v1.x` is the latest stable branch as of this writing.)


### Step 3: Commit

Make sure git knows your name and email address:
Expand Down Expand Up @@ -123,7 +115,7 @@ Use `git rebase` (not `git merge`) to sync your work from time to time.

```text
$ git fetch upstream
$ git rebase upstream/v1.x # or upstream/master
$ git rebase upstream/master
```


Expand All @@ -147,10 +139,10 @@ can use this syntax to run it exactly as the test harness would:
$ python tools/test.py -v --mode=release parallel/test-stream2-transform
```

You can run tests directly with node:
You can run tests directly with iojs:

```text
$ node ./test/parallel/test-streams2-transform.js
$ iojs ./test/parallel/test-streams2-transform.js
```


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ information about the governance of the io.js project, see
- Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D
* **Thorsten Lorenz** ([@thlorenz](https://github.com/thlorenz)) &lt;thlorenz@gmx.de&gt;
* **Stephen Belanger** ([@qard](https://github.com/qard)) &lt;admin@stephenbelanger.com&gt;
* **Jeremiah Senkpiel** ([@fishrock123](https://github.com/fishrock123)) &lt;fishrock123@rocketmail.com&gt;
* **Jeremiah Senkpiel** ([@fishrock123](https://github.com/fishrock123)) &lt;fishrock123@rocketmail.com&gt; (Technical Committee)
- Release GPG key: FD3A5288F042B6850C66B31F09FE44734EB7990E
* **Evan Lucas** ([@evanlucas](https://github.com/evanlucas)) &lt;evanlucas@me.com&gt;
* **Brendan Ashworth** ([@brendanashworth](https://github.com/brendanashworth)) &lt;brendan.ashworth@me.com&gt;
Expand Down
2 changes: 1 addition & 1 deletion WORKING_GROUPS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# io.js Working Groups

io.js Working Groups are autonomous projects created by the
[Technical Committee (TC)](https://github.com/iojs/io.js/blob/v1.x/GOVERNANCE.md#technical-committee).
[Technical Committee (TC)](https://github.com/iojs/io.js/blob/master/GOVERNANCE.md#technical-committee).

Working Groups can be formed at any time but must be ratified by the TC.
Once formed the work defined in the Working Group charter is the
Expand Down
2 changes: 1 addition & 1 deletion doc/api/child_process.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ be sent `'SIGTERM'`. See `signal(7)` for a list of available signals.
grep = spawn('grep', ['ssh']);

grep.on('close', function (code, signal) {
console.log('child process terminated due to receipt of signal '+signal);
console.log('child process terminated due to receipt of signal ' + signal);
});

// send SIGHUP to process
Expand Down
2 changes: 2 additions & 0 deletions doc/api/net.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ For TCP sockets, `options` argument should be an object which specifies:
- `localPort`: Local port to bind to for network connections.

- `family` : Version of IP stack. Defaults to `4`.

- `lookup` : Custom lookup function. Defaults to `dns.lookup`.

For local domain sockets, `options` argument should be an object which
specifies:
Expand Down
2 changes: 2 additions & 0 deletions lib/_http_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ function ClientRequest(options, cb) {

if (typeof options === 'string') {
options = url.parse(options);
} else {
options = util._extend({}, options);
}

var agent = options.agent;
Expand Down
3 changes: 2 additions & 1 deletion lib/_tls_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,8 @@ exports.connect = function(/* [port, host], options, cb */) {

var hostname = options.servername ||
options.host ||
options.socket && options.socket._host,
(options.socket && options.socket._host) ||
'localhost',
NPN = {},
context = tls.createSecureContext(options);
tls.convertNPNProtocols(options.NPNProtocols, NPN);
Expand Down
10 changes: 5 additions & 5 deletions lib/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ Buffer.concat = function(list, length) {
if (!Array.isArray(list))
throw new TypeError('list argument must be an Array of Buffers.');

if (list.length === 0)
return new Buffer(0);
else if (list.length === 1)
return list[0];

if (length === undefined) {
length = 0;
for (var i = 0; i < list.length; i++)
Expand All @@ -255,11 +260,6 @@ Buffer.concat = function(list, length) {
length = length >>> 0;
}

if (list.length === 0)
return new Buffer(0);
else if (list.length === 1)
return list[0];

var buffer = new Buffer(length);
var pos = 0;
for (var i = 0; i < list.length; i++) {
Expand Down
4 changes: 3 additions & 1 deletion lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,9 @@ Module._initPaths = function() {

var nodePath = process.env['NODE_PATH'];
if (nodePath) {
paths = nodePath.split(path.delimiter).concat(paths);
paths = nodePath.split(path.delimiter).filter(function(path) {
return !!path;
}).concat(paths);
}

modulePaths = paths;
Expand Down
Loading