| 2374 | } |
| 2375 | |
| 2376 | static int updateTLSPort(long long val, long long prev, const char **err) { |
| 2377 | /* Do nothing if port is unchanged */ |
| 2378 | if (val == prev) { |
| 2379 | return 1; |
| 2380 | } |
| 2381 | |
| 2382 | /* Configure TLS if tls is enabled */ |
| 2383 | if (prev == 0 && tlsConfigure(&server.tls_ctx_config) == C_ERR) { |
| 2384 | *err = "Unable to update TLS configuration. Check server logs."; |
| 2385 | return 0; |
| 2386 | } |
| 2387 | |
| 2388 | if (changeListenPort(val, &server.tlsfd, acceptTLSHandler) == C_ERR) { |
| 2389 | *err = "Unable to listen on this port. Check server logs."; |
| 2390 | return 0; |
| 2391 | } |
| 2392 | |
| 2393 | return 1; |
| 2394 | } |
| 2395 | |
| 2396 | #endif /* USE_OPENSSL */ |
| 2397 |
nothing calls this directly
no test coverage detected