]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix unit test for added ulimit checks.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 24 Feb 2021 14:30:12 +0000 (15:30 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 24 Feb 2021 14:30:12 +0000 (15:30 +0100)
doc/Changelog
services/listen_dnsport.c
services/listen_dnsport.h
util/config_file.c
util/config_file.h

index b7af9c4635259e39eecfebd6d6c88736ab85a3a4..9492bc98865f54b9653f8465994fc3ded23a75a3 100644 (file)
@@ -8,6 +8,7 @@
        - On startup of unbound it checks if rlimits on memory size look
          sufficient for the configured cache size, and logs warning if not.
        - Fix function documentation.
+       - Fix unit test for added ulimit checks.
 
 23 February 2021: Wouter
        - Fix for zonemd, that domain-insecure zones work without dnssec.
index 7a90677a4c7e7c117c4a19ff5904401f4630d483..64d22d4d82997fde32ac35247f648b96fbe3cb48 100644 (file)
@@ -1093,31 +1093,6 @@ if_is_ssl(const char* ifname, const char* port, int ssl_port,
        return 0;
 }
 
-/** see if interface is https, its port number == the https port number */
-static int
-if_is_https(const char* ifname, const char* port, int https_port)
-{
-       char* p = strchr(ifname, '@');
-       if(!p && atoi(port) == https_port)
-               return 1;
-       if(p && atoi(p+1) == https_port)
-               return 1;
-       return 0;
-}
-
-/** see if config contains https turned on */
-int cfg_has_https(struct config_file* cfg)
-{
-       int i;
-       char portbuf[32];
-       snprintf(portbuf, sizeof(portbuf), "%d", cfg->port);
-       for(i = 0; i<cfg->num_ifs; i++) {
-               if(if_is_https(cfg->ifs[i], portbuf, cfg->https_port))
-                       return 1;
-       }
-       return 0;
-}
-
 /**
  * Helper for ports_open. Creates one interface (or NULL for default).
  * @param ifname: The interface ip address.
index 77062f68dc35974b1ae942572e3e096a2b37321a..f438ff4580f762265d1b9d9ae81b390fb11c916e 100644 (file)
@@ -147,13 +147,6 @@ void listening_ports_free(struct listen_port* list);
 int resolve_interface_names(struct config_file* cfg, char*** resif,
        int* num_resif);
 
-/**
- * Return true if the config contains settinsg that enable https.
- * @param cfg: config information.
- * @return true if https ports are used for server.
- */
-int cfg_has_https(struct config_file* cfg);
-
 /**
  * Create commpoints with for this thread for the shared ports.
  * @param base: the comm_base that provides event functionality.
index 9090e595ca54f4aa916d0b957e60088a551edca4..171251f67ff1d2e972c18346c4f89e6a2dd9025a 100644 (file)
@@ -2608,3 +2608,27 @@ int options_remote_is_address(struct config_file* cfg)
        return (cfg->control_ifs.first->str[0] != '/');
 }
 
+/** see if interface is https, its port number == the https port number */
+int
+if_is_https(const char* ifname, const char* port, int https_port)
+{
+       char* p = strchr(ifname, '@');
+       if(!p && atoi(port) == https_port)
+               return 1;
+       if(p && atoi(p+1) == https_port)
+               return 1;
+       return 0;
+}
+
+/** see if config contains https turned on */
+int cfg_has_https(struct config_file* cfg)
+{
+       int i;
+       char portbuf[32];
+       snprintf(portbuf, sizeof(portbuf), "%d", cfg->port);
+       for(i = 0; i<cfg->num_ifs; i++) {
+               if(if_is_https(cfg->ifs[i], portbuf, cfg->https_port))
+                       return 1;
+       }
+       return 0;
+}
index 9d3297f7babb12fd3d930de9efeec358c1141adb..1042bd87951192652a5a4df2873c7b0c8ebb0acc 100644 (file)
@@ -1305,5 +1305,15 @@ void w_config_adjust_directory(struct config_file* cfg);
 /** debug option for unit tests. */
 extern int fake_dsa, fake_sha1;
 
+/** see if interface is https, its port number == the https port number */
+int if_is_https(const char* ifname, const char* port, int https_port);
+
+/**
+ * Return true if the config contains settinsg that enable https.
+ * @param cfg: config information.
+ * @return true if https ports are used for server.
+ */
+int cfg_has_https(struct config_file* cfg);
+
 #endif /* UTIL_CONFIG_FILE_H */