Skip to content

Commit

Permalink
src: use ARES_SUCCESS instead of 0
Browse files Browse the repository at this point in the history
Since error messages are also using defined values, it is more clear
to use the defined value even when the operation succeeds.

PR-URL: #48834
Reviewed-By: Paolo Insogna <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Daeyeon Jeong <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Deokjin Kim <[email protected]>
  • Loading branch information
illusi0n7 authored and RafaelGSS committed Aug 15, 2023
1 parent be7b511 commit 578c3d1
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/cares_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ int AnyTraits::Parse(
return status;

wrap->CallOnComplete(ret);
return 0;
return ARES_SUCCESS;
}

int ATraits::Parse(
Expand Down Expand Up @@ -1086,7 +1086,7 @@ int ATraits::Parse(
Local<Array> ttls = AddrTTLToArray<ares_addrttl>(env, addrttls, naddrttls);

wrap->CallOnComplete(ret, ttls);
return 0;
return ARES_SUCCESS;
}

int AaaaTraits::Parse(
Expand Down Expand Up @@ -1120,7 +1120,7 @@ int AaaaTraits::Parse(
Local<Array> ttls = AddrTTLToArray<ares_addr6ttl>(env, addrttls, naddrttls);

wrap->CallOnComplete(ret, ttls);
return 0;
return ARES_SUCCESS;
}

int CaaTraits::Parse(
Expand All @@ -1142,7 +1142,7 @@ int CaaTraits::Parse(
return status;

wrap->CallOnComplete(ret);
return 0;
return ARES_SUCCESS;
}

int CnameTraits::Parse(
Expand All @@ -1165,7 +1165,7 @@ int CnameTraits::Parse(
return status;

wrap->CallOnComplete(ret);
return 0;
return ARES_SUCCESS;
}

int MxTraits::Parse(
Expand All @@ -1188,7 +1188,7 @@ int MxTraits::Parse(
return status;

wrap->CallOnComplete(mx_records);
return 0;
return ARES_SUCCESS;
}

int NsTraits::Parse(
Expand All @@ -1211,7 +1211,7 @@ int NsTraits::Parse(
return status;

wrap->CallOnComplete(names);
return 0;
return ARES_SUCCESS;
}

int TxtTraits::Parse(
Expand All @@ -1233,7 +1233,7 @@ int TxtTraits::Parse(
return status;

wrap->CallOnComplete(txt_records);
return 0;
return ARES_SUCCESS;
}

int SrvTraits::Parse(
Expand All @@ -1255,7 +1255,7 @@ int SrvTraits::Parse(
return status;

wrap->CallOnComplete(srv_records);
return 0;
return ARES_SUCCESS;
}

int PtrTraits::Parse(
Expand All @@ -1279,7 +1279,7 @@ int PtrTraits::Parse(
return status;

wrap->CallOnComplete(aliases);
return 0;
return ARES_SUCCESS;
}

int NaptrTraits::Parse(
Expand All @@ -1301,7 +1301,7 @@ int NaptrTraits::Parse(
return status;

wrap->CallOnComplete(naptr_records);
return 0;
return ARES_SUCCESS;
}

int SoaTraits::Parse(
Expand Down Expand Up @@ -1352,7 +1352,7 @@ int SoaTraits::Parse(
ares_free_data(soa_out);

wrap->CallOnComplete(soa_record);
return 0;
return ARES_SUCCESS;
}

int ReverseTraits::Send(GetHostByAddrWrap* wrap, const char* name) {
Expand Down Expand Up @@ -1396,7 +1396,7 @@ int ReverseTraits::Parse(
HandleScope handle_scope(env->isolate());
Context::Scope context_scope(env->context());
wrap->CallOnComplete(HostentToNames(env, host));
return 0;
return ARES_SUCCESS;
}

namespace {
Expand Down

0 comments on commit 578c3d1

Please sign in to comment.