{"action":"created","issue":{"url":"https://api.github.com/repos/iojs/io.js/issues/465","labels_url":"https://api.github.com/repos/iojs/io.js/issues/465/labels{/name}","comments_url":"https://api.github.com/repos/iojs/io.js/issues/465/comments","events_url":"https://api.github.com/repos/iojs/io.js/issues/465/events","html_url":"https://github.com/iojs/io.js/pull/465","id":54547885,"number":465,"title":"Cleanup stream state in net","user":{"login":"chrisdickinson","id":37303,"avatar_url":"https://avatars.githubusercontent.com/u/37303?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdickinson","html_url":"https://github.com/chrisdickinson","followers_url":"https://api.github.com/users/chrisdickinson/followers","following_url":"https://api.github.com/users/chrisdickinson/following{/other_user}","gists_url":"https://api.github.com/users/chrisdickinson/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdickinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdickinson/subscriptions","organizations_url":"https://api.github.com/users/chrisdickinson/orgs","repos_url":"https://api.github.com/users/chrisdickinson/repos","events_url":"https://api.github.com/users/chrisdickinson/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdickinson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/iojs/io.js/labels/semver-minor","name":"semver-minor","color":"fef2c0"},{"url":"https://api.github.com/repos/iojs/io.js/labels/stream","name":"stream","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-01-16T07:37:30Z","updated_at":"2015-02-03T20:35:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/iojs/io.js/pulls/465","html_url":"https://github.com/iojs/io.js/pull/465","diff_url":"https://github.com/iojs/io.js/pull/465.diff","patch_url":"https://github.com/iojs/io.js/pull/465.patch"},"body":"part of #445\r\n\r\nThis set of patches removes much of the private state manipulation `net.Socket` was doing:\r\n\r\n* 58912a0: Removes the `this._writableState.decodeStrings = false` in favor of always setting `options.decodeStrings = false` before `stream.Duplex.call(this, options)`. \r\n* ee369cd: Instead of manually setting `this._readableState.flowing = false`, call [`this.pause()`](https://github.com/iojs/io.js/blob/v1.x/lib/_stream_readable.js#L715-L723). Since we have not returned from object instantiation, there should be no side effects.\r\n*  9c26dd1: A bit trickier: only destroy in `onSocketFinish` we are already not readable – whether that's because we started as `readable = false` *or* because we're [in the dead zone](https://github.com/iojs/io.js/blob/v1.x/lib/_stream_readable.js#L882-L890) between `ended = true` and `readable = false`. What this means in practice is that sockets that *would* have been destroyed here will instead be destroyed by `onSocketEnd` (as that `nextTick`'d function completes.)\r\n* 29e7d80: Maybe controversial, *but*: the `errorEmitted` attribute was *only* made available for the purposes of `net.Socket` (and `tls.TLSSocket`), and even then only for errors that they can intercept themselves. I moved that attribute down to those child classes, because there's no need within Writable to track that information (basically trying to localize the illicit information spillage).\r\n\r\nR=@rvagg, @isaacs, or @bnoordhuis ?\r\n"},"comment":{"url":"https://api.github.com/repos/iojs/io.js/issues/comments/72729114","html_url":"https://github.com/iojs/io.js/pull/465#issuecomment-72729114","issue_url":"https://api.github.com/repos/iojs/io.js/issues/465","id":72729114,"user":{"login":"Fishrock123","id":1093990,"avatar_url":"https://avatars.githubusercontent.com/u/1093990?v=3","gravatar_id":"","url":"https://api.github.com/users/Fishrock123","html_url":"https://github.com/Fishrock123","followers_url":"https://api.github.com/users/Fishrock123/followers","following_url":"https://api.github.com/users/Fishrock123/following{/other_user}","gists_url":"https://api.github.com/users/Fishrock123/gists{/gist_id}","starred_url":"https://api.github.com/users/Fishrock123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fishrock123/subscriptions","organizations_url":"https://api.github.com/users/Fishrock123/orgs","repos_url":"https://api.github.com/users/Fishrock123/repos","events_url":"https://api.github.com/users/Fishrock123/events{/privacy}","received_events_url":"https://api.github.com/users/Fishrock123/received_events","type":"User","site_admin":false},"created_at":"2015-02-03T20:35:26Z","updated_at":"2015-02-03T20:35:26Z","body":"Can the CI be run on this after fixups?"}}