return "Invalid symbols encoded";
case URI_ERRNO_INVALID_PORT:
return "Port number is bad";
+ case URI_ERRNO_TLD_MISSING:
+ return "TLD part is not detected";
+ case URI_ERRNO_HOST_MISSING:
+ return "Host part is missing";
}
+
return NULL;
}
uri->port = u.port;
if (!uri->hostlen) {
- return URI_ERRNO_BAD_FORMAT;
+ return URI_ERRNO_HOST_MISSING;
}
/* Now decode url symbols */
rspamd_tld_trie_callback, uri, &state, true) == 0) {
/* Ignore URL's without TLD if it is not a numeric URL */
if (!rspamd_url_is_ip (uri, pool)) {
- return URI_ERRNO_BAD_FORMAT;
+ return URI_ERRNO_TLD_MISSING;
}
}
URI_ERRNO_INVALID_PROTOCOL, /* No protocol was found */
URI_ERRNO_INVALID_PORT, /* Port number is bad */
URI_ERRNO_BAD_ENCODING, /* Bad characters encoding */
- URI_ERRNO_BAD_FORMAT
+ URI_ERRNO_BAD_FORMAT,
+ URI_ERRNO_TLD_MISSING,
+ URI_ERRNO_HOST_MISSING
};
enum rspamd_url_protocol {