Skip to content

Commit

Permalink
src: remove unused GetHostByNameWrap
Browse files Browse the repository at this point in the history
It was a wrapper for `ares_gethostbyname()` that I'm unsure about if
it was ever exposed at the binding layer, let alone the public API.

PR-URL: #17860
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jon Moss <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
  • Loading branch information
bnoordhuis authored and MylesBorins committed Jan 9, 2018
1 parent c02559e commit 4b7e5fe
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions src/cares_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1772,33 +1772,6 @@ class GetHostByAddrWrap: public QueryWrap {
};


class GetHostByNameWrap: public QueryWrap {
public:
explicit GetHostByNameWrap(ChannelWrap* channel, Local<Object> req_wrap_obj)
: QueryWrap(channel, req_wrap_obj) {
}

int Send(const char* name, int family) override {
ares_gethostbyname(channel_->cares_channel(),
name,
family,
Callback,
static_cast<void*>(static_cast<QueryWrap*>(this)));
return 0;
}

protected:
void Parse(struct hostent* host) override {
HandleScope scope(env()->isolate());

Local<Array> addresses = HostentToAddresses(env(), host);
Local<Integer> family = Integer::New(env()->isolate(), host->h_addrtype);

this->CallOnComplete(addresses, family);
}
};


template <class Wrap>
static void Query(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
Expand Down

0 comments on commit 4b7e5fe

Please sign in to comment.