Skip to content

Conversation

@indutny
Copy link
Member

TLSSocket wraps the original net.Socket, but writes/reads to/from
TLSSocket do not touch the timers of original net.Socket.

Introduce socket._parent property, and iterate through all parents
to unref timers and prevent timeout event on original net.Socket.

Fix: nodejs/node-v0.x-archive#9242

`TLSSocket` wraps the original `net.Socket`, but writes/reads to/from `TLSSocket` do not touch the timers of original `net.Socket`. Introduce `socket._parent` property, and iterate through all parents to unref timers and prevent timeout event on original `net.Socket`. Fix: nodejs/node-v0.x-archive#9242
@indutny
Copy link
MemberAuthor

cc @iojs/crypto

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it might be worth adding this as a helper function.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. ;)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not combine the 2 following lines into one if statement like:

if (socket) this._parent = socket, this._connecting = socket._connecting; 

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@cjihrig
Copy link
Contributor

LGTM if the tests pass

indutny added a commit that referenced this pull request Feb 19, 2015
`TLSSocket` wraps the original `net.Socket`, but writes/reads to/from `TLSSocket` do not touch the timers of original `net.Socket`. Introduce `socket._parent` property, and iterate through all parents to unref timers and prevent timeout event on original `net.Socket`. Fix: nodejs/node-v0.x-archive#9242 PR-URL: #891 Reviewed-By: Colin Ihrig <[email protected]>
@indutny
Copy link
MemberAuthor

Landed in 9b6b055, thank you!

@indutnyindutny closed this Feb 19, 2015
@indutnyindutny deleted the fix/gh-9242 branch February 19, 2015 17:45
indutny added a commit to nodejs/node-v0.x-archive that referenced this pull request Feb 19, 2015
`TLSSocket` wraps the original `net.Socket`, but writes/reads to/from `TLSSocket` do not touch the timers of original `net.Socket`. Introduce `socket._parent` property, and iterate through all parents to unref timers and prevent timeout event on original `net.Socket`. Fix: #9242 PR-URL: nodejs/node#891 Reviewed-By: Colin Ihrig <[email protected]>
@rvaggrvagg mentioned this pull request Feb 20, 2015
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@indutny@cjihrig@yorkie