mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-08 14:41:57 +08:00
removed restart function from platform. no longer trying to
restart if the X server connection was lost; since synergy is likely to be started by xdm or the user's xsession, it's better for synergy to simply terminate when the connection is lost. synergy will still restart due to other errors. also fixed numerous other minor bugs and cleaned some stuff up (like app error codes are now consistent and enumerated in Version.h, for lack of a better place). and boosted version and protocol numbers.
This commit is contained in:
@@ -59,13 +59,11 @@ CServer::open()
|
||||
}
|
||||
catch (XScreenOpenFailure&) {
|
||||
// can't open screen yet. wait a few seconds to retry.
|
||||
CThread::sleep(3.0);
|
||||
log((CLOG_INFO "failed to open screen"));
|
||||
return false;
|
||||
}
|
||||
catch (XUnknownClient& e) {
|
||||
// can't open screen yet. wait a few seconds to retry.
|
||||
CThread::sleep(3.0);
|
||||
log((CLOG_CRIT "unknown screen name `%s'", e.getName().c_str()));
|
||||
return false;
|
||||
}
|
||||
@@ -1135,7 +1133,9 @@ CServer::acceptClients(void*)
|
||||
listen->bind(m_config.getSynergyAddress());
|
||||
break;
|
||||
}
|
||||
catch (XSocketAddressInUse&) {
|
||||
catch (XSocketBind& e) {
|
||||
log((CLOG_DEBUG1 "bind failed: %s", e.getErrstr()));
|
||||
|
||||
// give up if we've waited too long
|
||||
if (timer.getTime() >= m_bindTimeout) {
|
||||
log((CLOG_DEBUG1 "waited too long to bind, giving up"));
|
||||
@@ -1143,7 +1143,6 @@ CServer::acceptClients(void*)
|
||||
}
|
||||
|
||||
// wait a bit before retrying
|
||||
log((CLOG_DEBUG1 "bind failed; waiting to retry"));
|
||||
CThread::sleep(5.0);
|
||||
}
|
||||
}
|
||||
@@ -1419,7 +1418,9 @@ CServer::acceptHTTPClients(void*)
|
||||
listen->bind(m_config.getHTTPAddress());
|
||||
break;
|
||||
}
|
||||
catch (XSocketAddressInUse&) {
|
||||
catch (XSocketBind& e) {
|
||||
log((CLOG_DEBUG1 "bind HTTP failed: %s", e.getErrstr()));
|
||||
|
||||
// give up if we've waited too long
|
||||
if (timer.getTime() >= m_bindTimeout) {
|
||||
log((CLOG_DEBUG1 "waited too long to bind HTTP, giving up"));
|
||||
@@ -1427,7 +1428,6 @@ CServer::acceptHTTPClients(void*)
|
||||
}
|
||||
|
||||
// wait a bit before retrying
|
||||
log((CLOG_DEBUG1 "bind HTTP failed; waiting to retry"));
|
||||
CThread::sleep(5.0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user