mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
ywebserver: try to use port 8080 if port 80 is not available
This commit is contained in:
committed by
Jacek Jendrzej
parent
4bb8fd218a
commit
860443c4e3
@@ -118,9 +118,17 @@ CWebserver::~CWebserver() {
|
||||
#define MAX_TIMEOUTS_TO_TEST 100
|
||||
bool CWebserver::run(void) {
|
||||
if (!listenSocket.listen(port, HTTPD_MAX_CONNECTIONS)) {
|
||||
dperror("Socket cannot bind and listen. Abort.\n");
|
||||
if (port != 80) {
|
||||
fprintf(stderr, "[yhttpd] Socket cannot bind and listen on port %d Abort.\n", port);
|
||||
return false;
|
||||
}
|
||||
fprintf(stderr, "[yhttpd] cannot bind and listen on port 80, retrying on port 8080.\n");
|
||||
port = 8080;
|
||||
if (!listenSocket.listen(port, HTTPD_MAX_CONNECTIONS)) {
|
||||
fprintf(stderr, "[yhttpd] Socket cannot bind and listen on port %d Abort.\n", port);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#ifdef Y_CONFIG_FEATURE_KEEP_ALIVE
|
||||
|
||||
// initialize values for select
|
||||
|
Reference in New Issue
Block a user