fix crashing issue when connection is reset #427
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
应该可以解决 #408 #372 #370 和 #410
重现方法:系统是 Mac 或 Windows 都可以,node 需要 v10。开启代理之后,访问一个页面,然后在加载完毕前访问新的页面或刷新,应该就会触发 ECONNRESET 的未捕获异常。
之前 node 8 版本是可以正常运行的,但是 node 10 不行,很可能是因为 node 10 引入了这个 commit:nodejs/node@6f3a177#diff-e04bb2b2c80feabbca11f04983e000cd 导致原先默认的 error 事件回调缺失,报错成了未捕获异常。