From: hno <> Date: Sun, 28 Apr 2002 04:54:49 +0000 (+0000) Subject: Assert that there is at least one port defined when trying to figure out X-Git-Tag: SQUID_3_0_PRE1~1032 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2727cdbd46e0ef368b9559897e029051492a6e2;p=thirdparty%2Fsquid.git Assert that there is at least one port defined when trying to figure out out port number.. --- diff --git a/src/tools.cc b/src/tools.cc index 20065db654..d347f36e86 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1,6 +1,6 @@ /* - * $Id: tools.cc,v 1.218 2002/04/11 21:34:03 hno Exp $ + * $Id: tools.cc,v 1.219 2002/04/27 22:54:49 hno Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -996,12 +996,12 @@ parseEtcHosts(void) int getMyPort(void) { -#if USE_SSL if (Config.Sockaddr.http) return ntohs(Config.Sockaddr.http->s.sin_port); - else +#if USE_SSL + if (Config.Sockaddr.https) return ntohs(Config.Sockaddr.https->s.sin_port); -#else - return ntohs(Config.Sockaddr.http->s.sin_port); #endif + fatal("No port defined"); + return 0; /* NOT REACHED */ }