We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d2430ee commit acbb629Copy full SHA for acbb629
1 file changed
src/cares_wrap.cc
@@ -145,14 +145,10 @@ void ares_sockstate_cb(void* data, ares_socket_t sock, int read, int write) {
145
ares_poll_cb);
146
147
} else {
148
- /* read == 0 and write == 0 this is c-ares's way of notifying us that */
149
- /* the socket is now closed. We must free the data associated with */
150
- /* socket. */
151
- CHECK(task &&
152
- "When an ares socket is closed we should have a handle for it");
153
-
154
- channel->task_list()->erase(it);
155
- channel->env()->CloseHandle(&task->poll_watcher, ares_poll_close_cb);
+ if (task != nullptr) {
+ channel->task_list()->erase(it);
+ channel->env()->CloseHandle(&task->poll_watcher, ares_poll_close_cb);
+ }
156
157
if (channel->task_list()->empty()) {
158
channel->CloseTimer();
@@ -683,7 +679,6 @@ GetNameInfoReqWrap::GetNameInfoReqWrap(
683
679
void ChannelWrap::AresTimeout(uv_timer_t* handle) {
684
680
ChannelWrap* channel = static_cast<ChannelWrap*>(handle->data);
685
681
CHECK_EQ(channel->timer_handle(), handle);
686
- CHECK_EQ(false, channel->task_list()->empty());
687
682
ares_process_fd(channel->cares_channel(), ARES_SOCKET_BAD, ARES_SOCKET_BAD);
688
}
689
0 commit comments