Browse Source

- fixed startup "Listening on" list: with tcp disabled ser listed tcp
sockets on startup, although it didn't really listen on them

Andrei Pelinescu-Onciul 21 years ago
parent
commit
478eb0de8f
2 changed files with 11 additions and 6 deletions
  1. 9 4
      socket_info.c
  2. 2 2
      socket_info.h

+ 9 - 4
socket_info.c

@@ -565,12 +565,17 @@ int fix_all_socket_lists()
 		if (add_interfaces(0, AF_INET, 0,  PROTO_UDP, &udp_listen)==0){
 			/* if ok, try to add the others too */
 #ifdef USE_TCP
-			if (add_interfaces(0, AF_INET, 0,  PROTO_TCP, &tcp_listen)!=0)
-				goto error;
+			if (!tcp_disable){
+				if (add_interfaces(0, AF_INET, 0,  PROTO_TCP, &tcp_listen)!=0)
+					goto error;
 #ifdef USE_TLS
-			if (add_interfaces(0, AF_INET, 0, PROTO_TLS, &tls_listen)!=0)
-				goto error;
+				if (!tls_disable){
+					if (add_interfaces(0, AF_INET, 0, PROTO_TLS,
+								&tls_listen)!=0)
+					goto error;
+				}
 #endif
+			}
 #endif
 		}else{
 			/* if error fall back to get hostname */

+ 2 - 2
socket_info.h

@@ -68,14 +68,14 @@ static inline int next_proto(unsigned short proto)
 			return PROTO_UDP;
 		case PROTO_UDP:
 #ifdef	USE_TCP
-			return PROTO_TCP;
+			return (tcp_disable)?0:PROTO_TCP;
 #else
 			return 0;
 #endif
 #ifdef USE_TCP
 		case PROTO_TCP:
 #ifdef USE_TLS
-			return PROTO_TLS;
+			return (tls_disable)?0:PROTO_TLS;
 #else
 			return 0;
 #endif