fetch: hardcode HTTPS port and fallback to /etc/services for other unknown ports.
This commit is contained in:
@ -201,12 +201,14 @@ fetch_default_port(const char *scheme)
|
||||
{
|
||||
struct servent *se;
|
||||
|
||||
if ((se = getservbyname(scheme, "tcp")) != NULL)
|
||||
return (ntohs(se->s_port));
|
||||
if (strcasecmp(scheme, SCHEME_FTP) == 0)
|
||||
return (FTP_DEFAULT_PORT);
|
||||
if (strcasecmp(scheme, SCHEME_HTTP) == 0)
|
||||
return (HTTP_DEFAULT_PORT);
|
||||
if (strcasecmp(scheme, SCHEME_HTTPS) == 0)
|
||||
return (HTTPS_DEFAULT_PORT);
|
||||
if ((se = getservbyname(scheme, "tcp")) != NULL)
|
||||
return (ntohs(se->s_port));
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user