Allow error message callback cancellation regardless of socket state.
authorMaxim Georgiev <maxgeorg@fb.com>
Mon, 17 Apr 2017 19:04:17 +0000 (12:04 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 17 Apr 2017 19:08:41 +0000 (12:08 -0700)
commit532b8c01aa05334af612233137a836bfe45c3c78
tree3957e8294d8b15d0aef12f0dd21c83d3f4088568
parent5da6f8de1779620e07722fea4d6e0bbc31e2e226
Allow error message callback cancellation regardless of socket state.

Summary: We should be able to reset error message callback in AsyncSocket evein if the socket is closed yet. It's common to keep callback installed while the socket is connected. Once the socket is closed, the deinitialization process starts. If the callback callee component gets deallocated before the socket object is deallocated, it should be able to cancel callbacks.

Reviewed By: yfeldblum

Differential Revision: D4897335

fbshipit-source-id: 8eee26f9ebcb78a01d55598be3aff6595a3ed852
folly/io/async/AsyncSocket.cpp