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 <cjihrig@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
  • Loading branch information
bnoordhuis authored and MylesBorins committed Jan 9, 2018
1 parent 294c5f4 commit 87b336a
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 87b336a

Please sign in to comment.