Update hostname to return inv parameter. Return proper code in list get length methods.

This commit is contained in:
Neel Goyal 2014-02-03 21:34:11 -05:00
parent 86896652a8
commit c8b16f0590
3 changed files with 6 additions and 6 deletions

View File

@ -80,9 +80,9 @@ getdns_hostname(struct getdns_context *context,
&& address_data->size == 16)) && address_data->size == 16))
req_type = GETDNS_RRTYPE_PTR; req_type = GETDNS_RRTYPE_PTR;
else else
return GETDNS_RETURN_WRONG_TYPE_REQUESTED; return GETDNS_RETURN_INVALID_PARAMETER;
if ((name = reverse_address(address_data)) == NULL) if ((name = reverse_address(address_data)) == NULL)
return GETDNS_RETURN_GENERIC_ERROR; return GETDNS_RETURN_INVALID_PARAMETER;
retval = getdns_general(context, name, req_type, extensions, retval = getdns_general(context, name, req_type, extensions,
userarg, transaction_id, callback); userarg, transaction_id, callback);
free(name); free(name);

View File

@ -44,7 +44,7 @@ getdns_return_t
getdns_list_get_length(const struct getdns_list * list, size_t * answer) getdns_list_get_length(const struct getdns_list * list, size_t * answer)
{ {
if (!list || !answer) if (!list || !answer)
return GETDNS_RETURN_NO_SUCH_LIST_ITEM; return GETDNS_RETURN_INVALID_PARAMETER;
*answer = list->numinuse; *answer = list->numinuse;
return GETDNS_RETURN_GOOD;; return GETDNS_RETURN_GOOD;;

View File

@ -160,9 +160,9 @@ getdns_hostname_sync(struct getdns_context *context,
&& address_data->size == 16)) && address_data->size == 16))
req_type = GETDNS_RRTYPE_PTR; req_type = GETDNS_RRTYPE_PTR;
else else
return GETDNS_RETURN_WRONG_TYPE_REQUESTED; return GETDNS_RETURN_INVALID_PARAMETER;
if ((name = reverse_address(address_data)) == NULL) if ((name = reverse_address(address_data)) == NULL)
return GETDNS_RETURN_GENERIC_ERROR; return GETDNS_RETURN_INVALID_PARAMETER;
retval = getdns_general_sync(context, name, req_type, extensions, retval = getdns_general_sync(context, name, req_type, extensions,
response); response);
free(name); free(name);