Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

http: fix assert on data/end after socket error #14087

Closed
wants to merge 1 commit into from

Conversation

misterdjules
Copy link

This change is a backport of 1a3ca82
from io.js.

Original commit message:

Read all pending data out of the socket on error event and ensure that
no data/end handlers will be invoked on socket.destroy().
Otherwise following assertion happens:

  AssertionError: null == true
      at TLSSocket.socketOnData (_http_client.js:308:3)
      at TLSSocket.emit (events.js:107:17)
      at TLSSocket.Readable.read (_stream_readable.js:373:10)
      at TLSSocket.socketCloseListener (_http_client.js:229:10)
      at TLSSocket.emit (events.js:129:20)
      at TCP.close (net.js:476:12)

Fix: #9348
PR-URL: nodejs/node#1103
Reviewed-By: Rod Vagg rod@vagg.org
Reviewed-By: Nicu Micleușanu micnic90@gmail.com

Fixes #9348.

This change is a backport of 1a3ca82
from io.js.

Original commit message:

  Read all pending data out of the socket on `error` event and ensure that
  no `data`/`end` handlers will be invoked on `socket.destroy()`.
  Otherwise following assertion happens:

      AssertionError: null == true
          at TLSSocket.socketOnData (_http_client.js:308:3)
          at TLSSocket.emit (events.js:107:17)
          at TLSSocket.Readable.read (_stream_readable.js:373:10)
          at TLSSocket.socketCloseListener (_http_client.js:229:10)
          at TLSSocket.emit (events.js:129:20)
          at TCP.close (net.js:476:12)

  Fix: nodejs#9348
  PR-URL: nodejs/node#1103
  Reviewed-By: Rod Vagg <rod@vagg.org>
  Reviewed-By: Nicu Micleușanu <micnic90@gmail.com>

Fixes nodejs#9348.
@misterdjules misterdjules added this to the 0.12.2 milestone Mar 25, 2015
indutny added a commit that referenced this pull request Mar 28, 2015
This change is a backport of 1a3ca82
from io.js.

Original commit message:

  Read all pending data out of the socket on `error` event and ensure that
  no `data`/`end` handlers will be invoked on `socket.destroy()`.
  Otherwise following assertion happens:

      AssertionError: null == true
          at TLSSocket.socketOnData (_http_client.js:308:3)
          at TLSSocket.emit (events.js:107:17)
          at TLSSocket.Readable.read (_stream_readable.js:373:10)
          at TLSSocket.socketCloseListener (_http_client.js:229:10)
          at TLSSocket.emit (events.js:129:20)
          at TCP.close (net.js:476:12)

  Fix: #9348
  PR-URL: nodejs/node#1103
  Reviewed-By: Rod Vagg <rod@vagg.org>
  Reviewed-By: Nicu Micleușanu <micnic90@gmail.com>

Fixes #9348.

Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
PR-URL: #14087
@misterdjules
Copy link
Author

Landed in d6484f3.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants