WSADATA initResult;
if (WSAStartup(requiredVersion, &initResult) != 0)
- throw rdr::socket_error("unable to initialise Winsock2", errorNumber);
+ throw rdr::socket_error("Unable to initialise Winsock2", errorNumber);
#else
signal(SIGPIPE, SIG_IGN);
#endif
// Accept an incoming connection
if ((new_sock = ::accept(fd, nullptr, nullptr)) < 0)
- throw rdr::socket_error("unable to accept new connection", errorNumber);
+ throw rdr::socket_error("Unable to accept new connection", errorNumber);
// Create the socket object & check connection is allowed
Socket* s = createSocket(new_sock);
if (::listen(sock, 5) < 0) {
int e = errorNumber;
closesocket(sock);
- throw rdr::socket_error("unable to set socket to listening mode", e);
+ throw rdr::socket_error("Unable to set socket to listening mode", e);
}
fd = sock;
addr.sin_addr.s_addr = INADDR_ANY;
if ((sock = socket (AF_INET, SOCK_STREAM, 0)) < 0)
- throw socket_error("unable to create socket", errorNumber);
+ throw socket_error("Unable to create socket", errorNumber);
addr.sin_port = 0;
if (bind (sock, (struct sockaddr *)&addr, sizeof (addr)) < 0)
- throw socket_error("unable to find free port", errorNumber);
+ throw socket_error("Unable to find free port", errorNumber);
socklen_t n = sizeof(addr);
if (getsockname (sock, (struct sockaddr *)&addr, &n) < 0)
- throw socket_error("unable to get port number", errorNumber);
+ throw socket_error("Unable to get port number", errorNumber);
closesocket (sock);
return ntohs(addr.sin_port);
hints.ai_next = nullptr;
if ((result = getaddrinfo(host, nullptr, &hints, &ai)) != 0) {
- throw getaddrinfo_error("unable to resolve host by name", result);
+ throw getaddrinfo_error("Unable to resolve host by name", result);
}
sock = -1;
if (sock == -1) {
err = errorNumber;
freeaddrinfo(ai);
- throw socket_error("unable to create socket", err);
+ throw socket_error("Unable to create socket", err);
}
/* Attempt to connect to the remote host */
if (err == 0)
throw std::runtime_error("No useful address for host");
else
- throw socket_error("unable to connect to socket", err);
+ throw socket_error("Unable to connect to socket", err);
}
// Take proper ownership of the socket
parts = rfb::split(&p[1], '/');
if (parts.size() > 2)
- throw std::invalid_argument("invalid filter specified");
+ throw std::invalid_argument("Invalid filter specified");
if (parts[0].empty()) {
// Match any address
pattern.prefixlen = 128;
break;
default:
- throw std::runtime_error("unknown address family");
+ throw std::runtime_error("Unknown address family");
}
}
}
family = pattern.address.u.sa.sa_family;
if (pattern.prefixlen > (family == AF_INET ? 32: 128))
- throw std::invalid_argument(rfb::format("invalid prefix length for "
+ throw std::invalid_argument(rfb::format("Invalid prefix length for "
"filter address: %u",
pattern.prefixlen));
socklen_t salen;
if (strlen(path) >= sizeof(addr.sun_path))
- throw socket_error("socket path is too long", ENAMETOOLONG);
+ throw socket_error("Socket path is too long", ENAMETOOLONG);
// - Create a socket
sock = socket(AF_UNIX, SOCK_STREAM, 0);
if (sock == -1)
- throw socket_error("unable to create socket", errno);
+ throw socket_error("Unable to create socket", errno);
// - Attempt to connect
memset(&addr, 0, sizeof(addr));
int err, result;
if (strlen(path) >= sizeof(addr.sun_path))
- throw socket_error("socket path is too long", ENAMETOOLONG);
+ throw socket_error("Socket path is too long", ENAMETOOLONG);
// - Create a socket
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
EAX_DIGEST(&eaxCtx256, aes256_encrypt, 16, macComputed);
}
if (memcmp(mac, macComputed, 16) != 0)
- throw std::runtime_error("AESInStream: failed to authenticate message");
+ throw std::runtime_error("AESInStream: Failed to authenticate message");
in->setptr(2 + length + 16);
end += length;
{
while (bytesIn > 0) {
if (!hasData(1))
- throw std::runtime_error("ZlibInStream: failed to flush remaining stream data");
+ throw std::runtime_error("ZlibInStream: Failed to flush remaining stream data");
skip(avail());
}
bool ZlibInStream::fillBuffer()
{
if (!underlying)
- throw std::runtime_error("ZlibInStream overrun: no underlying stream");
+ throw std::runtime_error("ZlibInStream overrun: No underlying stream");
zs->next_out = (uint8_t*)end;
zs->avail_out = availSpace();
int rc;
if (!underlying)
- throw std::runtime_error("ZlibOutStream: underlying OutStream has not been set");
+ throw std::runtime_error("ZlibOutStream: Underlying OutStream has not been set");
if ((flush == Z_NO_FLUSH) && (zs->avail_in == 0))
return;
case RFBSTATE_INITIALISATION: return processInitMsg(); break;
case RFBSTATE_NORMAL: return reader_->readMsg(); break;
case RFBSTATE_CLOSING:
- throw std::logic_error("CConnection::processMsg: called while closing");
+ throw std::logic_error("CConnection::processMsg: Called while closing");
case RFBSTATE_UNINITIALISED:
- throw std::logic_error("CConnection::processMsg: not initialised yet?");
+ throw std::logic_error("CConnection::processMsg: Not initialised yet?");
default:
- throw std::logic_error("CConnection::processMsg: invalid state");
+ throw std::logic_error("CConnection::processMsg: Invalid state");
}
}
if (sscanf(verStr, "RFB %03d.%03d\n",
&majorVersion, &minorVersion) != 2) {
state_ = RFBSTATE_INVALID;
- throw protocol_error("reading version failed: not an RFB server?");
+ throw protocol_error("Reading version failed, not an RFB server?");
}
server.setVersion(majorVersion, minorVersion);
std::vector<uint8_t> bBytes(keyLength);
if (!rs.hasData(keyLength))
- throw std::runtime_error("failed to generate DH private key");
+ throw std::runtime_error("Failed to generate DH private key");
rs.readBytes(bBytes.data(), bBytes.size());
nettle_mpz_set_str_256_u(b, bBytes.size(), bBytes.data());
mpz_powm(k, A, b, p);
uint8_t buf[128];
if (!rs.hasData(128))
- throw std::runtime_error("failed to generate random padding");
+ throw std::runtime_error("Failed to generate random padding");
rs.readBytes(buf, 128);
if (username.size() >= 64)
- throw std::out_of_range("username is too long");
+ throw std::out_of_range("Username is too long");
memcpy(buf, username.c_str(), username.size() + 1);
if (password.size() >= 64)
- throw std::out_of_range("password is too long");
+ throw std::out_of_range("Password is too long");
memcpy(buf + 64, password.c_str(), password.size() + 1);
aes128_encrypt(&aesCtx, 128, buf, buf);
std::vector<uint8_t> bBytes(8);
if (!rs.hasData(8))
- throw std::runtime_error("failed to generate DH private key");
+ throw std::runtime_error("Failed to generate DH private key");
rs.readBytes(bBytes.data(), bBytes.size());
nettle_mpz_set_str_256_u(b, bBytes.size(), bBytes.data());
mpz_powm(k, A, b, p);
}
if (!rs.hasData(256 + 64))
- throw std::runtime_error("failed to generate random padding");
+ throw std::runtime_error("Failed to generate random padding");
rs.readBytes(user, 256);
rs.readBytes(pass, 64);
if (username.size() >= 256)
- throw std::out_of_range("username is too long");
+ throw std::out_of_range("Username is too long");
memcpy(user, username.c_str(), username.size() + 1);
if (password.size() >= 64)
- throw std::out_of_range("password is too long");
+ throw std::out_of_range("Password is too long");
memcpy(pass, password.c_str(), password.size() + 1);
// DES-CBC with the original key as IV, and the reversed one as the DES key
{
rdr::RandomStream* rs = (rdr::RandomStream*)ctx;
if (!rs->hasData(length))
- throw std::runtime_error("failed to generate random");
+ throw std::runtime_error("Failed to generate random");
rs->readBytes(dst, length);
}
if (!rsa_generate_keypair(&clientPublicKey, &clientKey,
&rs, random_func, nullptr, nullptr,
clientKeyLength, 0))
- throw std::runtime_error("failed to generate key");
+ throw std::runtime_error("Failed to generate key");
clientKeyN = new uint8_t[rsaKeySize];
clientKeyE = new uint8_t[rsaKeySize];
nettle_mpz_get_str_256(rsaKeySize, clientKeyN, clientPublicKey.n);
is->setRestorePoint();
serverKeyLength = is->readU32();
if (serverKeyLength < MinKeyLength)
- throw protocol_error("server key is too short");
+ throw protocol_error("Server key is too short");
if (serverKeyLength > MaxKeyLength)
- throw protocol_error("server key is too long");
+ throw protocol_error("Server key is too long");
size_t size = (serverKeyLength + 7) / 8;
if (!is->hasDataOrRestore(size * 2))
return false;
nettle_mpz_set_str_256_u(serverKey.n, size, serverKeyN);
nettle_mpz_set_str_256_u(serverKey.e, size, serverKeyE);
if (!rsa_public_key_prepare(&serverKey))
- throw protocol_error("server key is invalid");
+ throw protocol_error("Server key is invalid");
return true;
}
{
rdr::OutStream* os = cc->getOutStream();
if (!rs.hasData(keySize / 8))
- throw std::runtime_error("failed to generate random");
+ throw std::runtime_error("Failed to generate random");
rs.readBytes(clientRandom, keySize / 8);
mpz_t x;
mpz_init(x);
}
if (!res) {
mpz_clear(x);
- throw std::runtime_error("failed to encrypt random");
+ throw std::runtime_error("Failed to encrypt random");
}
uint8_t* buffer = new uint8_t[serverKey.size];
nettle_mpz_get_str_256(serverKey.size, buffer, x);
is->setRestorePoint();
size_t size = is->readU16();
if (size != clientKey.size)
- throw protocol_error("client key length doesn't match");
+ throw protocol_error("Client key length doesn't match");
if (!is->hasDataOrRestore(size))
return false;
is->clearRestorePoint();
if (!rsa_decrypt(&clientKey, &randomSize, serverRandom, x) ||
randomSize != (size_t)keySize / 8) {
mpz_clear(x);
- throw protocol_error("failed to decrypt server random");
+ throw protocol_error("Failed to decrypt server random");
}
mpz_clear(x);
return true;
sha256_digest(&ctx, hashSize, realHash);
}
if (memcmp(hash, realHash, hashSize) != 0)
- throw protocol_error("hash doesn't match");
+ throw protocol_error("Hash doesn't match");
return true;
}
return false;
subtype = rais->readU8();
if (subtype != secTypeRA2UserPass && subtype != secTypeRA2Pass)
- throw protocol_error("unknown RSA-AES subtype");
+ throw protocol_error("Unknown RSA-AES subtype");
return true;
}
if (subtype == secTypeRA2UserPass) {
if (username.size() > 255)
- throw std::out_of_range("username is too long");
+ throw std::out_of_range("Username is too long");
raos->writeU8(username.size());
raos->writeBytes((const uint8_t*)username.data(), username.size());
} else {
}
if (password.size() > 255)
- throw std::out_of_range("password is too long");
+ throw std::out_of_range("Password is too long");
raos->writeU8(password.size());
raos->writeBytes((const uint8_t*)password.data(), password.size());
raos->flush();
return;
if (gnutls_certificate_type_get(session) != GNUTLS_CRT_X509)
- throw protocol_error("unsupported certificate type");
+ throw protocol_error("Unsupported certificate type");
err = gnutls_certificate_verify_peers2(session, &status);
if (err != 0) {
vlog.error("Server certificate verification failed: %s", gnutls_strerror(err));
- throw rdr::tls_error("server certificate verification()", err);
+ throw rdr::tls_error("Server certificate verification()", err);
}
if (status != 0) {
cert_list = gnutls_certificate_get_peers(session, &cert_list_size);
if (!cert_list_size)
- throw protocol_error("empty certificate chain");
+ throw protocol_error("Empty certificate chain");
/* Process only server's certificate, not issuer's certificate */
gnutls_x509_crt_t crt;
pf_ = pf;
if (pf.bpp != 8 && pf.bpp != 16 && pf.bpp != 32)
- throw std::invalid_argument("setPF: not 8, 16 or 32 bpp?");
+ throw std::invalid_argument("setPF: Not 8, 16 or 32 bpp?");
}
void ClientParams::setName(const char* name)
|| strcasecmp(v, "false") == 0 || strcasecmp(v, "no") == 0)
setParam(false);
else {
- vlog.error("Bool parameter %s: invalid value '%s'", getName(), v);
+ vlog.error("Bool parameter %s: Invalid value '%s'", getName(), v);
return false;
}
hostStart = &hi[1];
hostEnd = strchr(hostStart, ']');
if (hostEnd == nullptr)
- throw std::invalid_argument("unmatched [ in host");
+ throw std::invalid_argument("Unmatched [ in host");
portStart = hostEnd + 1;
if (isAllSpace(portStart))
char* end;
if (portStart[0] != ':')
- throw std::invalid_argument("invalid port specified");
+ throw std::invalid_argument("Invalid port specified");
if (portStart[1] != ':')
*port = strtol(portStart + 1, &end, 10);
else
*port = strtol(portStart + 2, &end, 10);
if (*end != '\0' && ! isAllSpace(end))
- throw std::invalid_argument("invalid port specified");
+ throw std::invalid_argument("Invalid port specified");
if ((portStart[1] != ':') && (*port < 100))
*port += basePort;
std::vector<std::string> parts;
parts = split(params, ':');
if (parts.size() != 3) {
- fprintf(stderr,"failed to parse log params:%s\n",params);
+ fprintf(stderr, "Failed to parse log params:%s\n",params);
return false;
}
int level = atoi(parts[2].c_str());
if (!parts[1].empty()) {
logger = Logger::getLogger(parts[1].c_str());
if (!logger)
- fprintf(stderr, "no logger found! %s\n", parts[1].c_str());
+ fprintf(stderr, "No logger found! %s\n", parts[1].c_str());
}
if (parts[0] == "*") {
LogWriter* current = log_writers;
} else {
LogWriter* logwriter = getLogWriter(parts[0].c_str());
if (!logwriter) {
- fprintf(stderr, "no logwriter found! %s\n", parts[0].c_str());
+ fprintf(stderr, "No logwriter found! %s\n", parts[0].c_str());
} else {
logwriter->setLog(logger);
logwriter->setLevel(level);
redShift(rs), greenShift(gs), blueShift(bs)
{
if (!isSane())
- throw std::invalid_argument("invalid pixel format");
+ throw std::invalid_argument("Invalid pixel format");
updateState();
}
}
if (!isSane())
- throw protocol_error("invalid pixel format");
+ throw protocol_error("Invalid pixel format");
updateState();
}
case RFBSTATE_INITIALISATION: return processInitMsg(); break;
case RFBSTATE_NORMAL: return reader_->readMsg(); break;
case RFBSTATE_QUERYING:
- throw std::logic_error("SConnection::processMsg: bogus data from "
+ throw std::logic_error("SConnection::processMsg: Bogus data from "
"client while querying");
case RFBSTATE_CLOSING:
- throw std::logic_error("SConnection::processMsg: called while closing");
+ throw std::logic_error("SConnection::processMsg: Called while closing");
case RFBSTATE_UNINITIALISED:
- throw std::logic_error("SConnection::processMsg: not initialised yet?");
+ throw std::logic_error("SConnection::processMsg: Not initialised yet?");
default:
- throw std::logic_error("SConnection::processMsg: invalid state");
+ throw std::logic_error("SConnection::processMsg: Invalid state");
}
}
if (sscanf(verStr, "RFB %03d.%03d\n",
&majorVersion, &minorVersion) != 2) {
state_ = RFBSTATE_INVALID;
- throw protocol_error("reading version failed: not an RFB client?");
+ throw protocol_error("Reading version failed, not an RFB client?");
}
client.setVersion(majorVersion, minorVersion);
void SConnection::handleAuthFailureTimeout(Timer* /*t*/)
{
if (state_ != RFBSTATE_SECURITY_FAILURE) {
- close("SConnection::handleAuthFailureTimeout: invalid state");
+ close("SConnection::handleAuthFailureTimeout: Invalid state");
return;
}
bool SConnection::accessCheck(AccessRights ar) const
{
if (state_ < RFBSTATE_QUERYING)
- throw std::logic_error("SConnection::accessCheck: invalid state");
+ throw std::logic_error("SConnection::accessCheck: Invalid state");
return (accessRights & ar) == ar;
}
void SConnection::approveConnection(bool accept, const char* reason)
{
if (state_ != RFBSTATE_QUERYING)
- throw std::logic_error("SConnection::approveConnection: invalid state");
+ throw std::logic_error("SConnection::approveConnection: Invalid state");
if (!client.beforeVersion(3,8) || ssecurity->getType() != secTypeNone) {
if (accept) {
ret = readQEMUMessage();
break;
default:
- vlog.error("unknown message type %d", currentMsgType);
- throw protocol_error("unknown message type");
+ vlog.error("Unknown message type %d", currentMsgType);
+ throw protocol_error("Unknown message type");
}
if (ret)
ret = readQEMUKeyEvent();
break;
default:
- throw protocol_error(format("unknown QEMU submessage type %d", subType));
+ throw protocol_error(format("Unknown QEMU submessage type %d", subType));
}
if (!ret) {
{
FILE* file = fopen(keyFile, "rb");
if (!file)
- throw rdr::posix_error("failed to open key file", errno);
+ throw rdr::posix_error("Failed to open key file", errno);
fseek(file, 0, SEEK_END);
size_t size = ftell(file);
if (size == 0 || size > MaxKeyFileSize) {
fclose(file);
- throw std::runtime_error("size of key file is zero or too big");
+ throw std::runtime_error("Size of key file is zero or too big");
}
fseek(file, 0, SEEK_SET);
std::vector<uint8_t> data(size);
if (fread(data.data(), 1, data.size(), file) != size) {
fclose(file);
- throw rdr::posix_error("failed to read key", errno);
+ throw rdr::posix_error("Failed to read key", errno);
}
fclose(file);
loadPKCS8Key(der.data(), der.size());
return;
}
- throw std::runtime_error("failed to import key");
+ throw std::runtime_error("Failed to import key");
}
void SSecurityRSAAES::loadPKCS1Key(const uint8_t* data, size_t size)
if (!rsa_keypair_from_der(&pub, &serverKey, 0, size, data)) {
rsa_private_key_clear(&serverKey);
rsa_public_key_clear(&pub);
- throw std::runtime_error("failed to import key");
+ throw std::runtime_error("Failed to import key");
}
serverKeyLength = serverKey.size * 8;
serverKeyN = new uint8_t[serverKey.size];
loadPKCS1Key(i.data, i.length);
return;
failed:
- throw std::runtime_error("failed to import key");
+ throw std::runtime_error("Failed to import key");
}
bool SSecurityRSAAES::processMsg()
is->setRestorePoint();
clientKeyLength = is->readU32();
if (clientKeyLength < MinKeyLength)
- throw protocol_error("client key is too short");
+ throw protocol_error("Client key is too short");
if (clientKeyLength > MaxKeyLength)
- throw protocol_error("client key is too long");
+ throw protocol_error("Client key is too long");
size_t size = (clientKeyLength + 7) / 8;
if (!is->hasDataOrRestore(size * 2))
return false;
nettle_mpz_set_str_256_u(clientKey.n, size, clientKeyN);
nettle_mpz_set_str_256_u(clientKey.e, size, clientKeyE);
if (!rsa_public_key_prepare(&clientKey))
- throw protocol_error("client key is invalid");
+ throw protocol_error("Client key is invalid");
return true;
}
{
rdr::RandomStream* rs = (rdr::RandomStream*)ctx;
if (!rs->hasData(length))
- throw std::runtime_error("failed to encrypt random");
+ throw std::runtime_error("Failed to encrypt random");
rs->readBytes(dst, length);
}
{
rdr::OutStream* os = sc->getOutStream();
if (!rs.hasData(keySize / 8))
- throw std::runtime_error("failed to generate random");
+ throw std::runtime_error("Failed to generate random");
rs.readBytes(serverRandom, keySize / 8);
mpz_t x;
mpz_init(x);
}
if (!res) {
mpz_clear(x);
- throw std::runtime_error("failed to encrypt random");
+ throw std::runtime_error("Failed to encrypt random");
}
uint8_t* buffer = new uint8_t[clientKey.size];
nettle_mpz_get_str_256(clientKey.size, buffer, x);
is->setRestorePoint();
size_t size = is->readU16();
if (size != serverKey.size)
- throw protocol_error("server key length doesn't match");
+ throw protocol_error("Server key length doesn't match");
if (!is->hasDataOrRestore(size))
return false;
is->clearRestorePoint();
if (!rsa_decrypt(&serverKey, &randomSize, clientRandom, x) ||
randomSize != (size_t)keySize / 8) {
mpz_clear(x);
- throw protocol_error("failed to decrypt client random");
+ throw protocol_error("Failed to decrypt client random");
}
mpz_clear(x);
return true;
sha256_digest(&ctx, hashSize, realHash);
}
if (memcmp(hash, realHash, hashSize) != 0)
- throw protocol_error("hash doesn't match");
+ throw protocol_error("Hash doesn't match");
return true;
}
pf_ = pf;
if (pf.bpp != 8 && pf.bpp != 16 && pf.bpp != 32)
- throw std::invalid_argument("setPF: not 8, 16 or 32 bpp?");
+ throw std::invalid_argument("setPF: Not 8, 16 or 32 bpp?");
}
void ServerParams::setName(const char* name)
// Quit on unsupported compression type.
if (comp_ctl > tightMaxSubencoding)
- throw protocol_error("TightDecoder: bad subencoding value received");
+ throw protocol_error("TightDecoder: Bad subencoding value received");
// "Basic" compression type.
int palSize = 0;
if (r.width() > TIGHT_MAX_WIDTH)
- throw protocol_error(format("TightDecoder: too large rectangle (%d pixels)", r.width()));
+ throw protocol_error(format("TightDecoder: Too large rectangle (%d pixels)", r.width()));
// Possible palette
if ((comp_ctl & tightExplicitFilter) != 0) {
break;
case tightFilterGradient:
if (server.pf().bpp == 8)
- throw protocol_error("TightDecoder: invalid BPP for gradient filter");
+ throw protocol_error("TightDecoder: Invalid BPP for gradient filter");
break;
case tightFilterCopy:
break;
default:
- throw protocol_error("TightDecoder: unknown filter code received");
+ throw protocol_error("TightDecoder: Unknown filter code received");
}
}
idleTimer(this), disconnectTimer(this), connectTimer(this),
msc(0), queuedMsc(0), frameTimer(this)
{
- slog.debug("creating single-threaded server %s", name.c_str());
+ slog.debug("Creating single-threaded server %s", name.c_str());
desktop_->init(this);
VNCServerST::~VNCServerST()
{
- slog.debug("shutting down server %s", name.c_str());
+ slog.debug("Shutting down server %s", name.c_str());
// Close any active clients, with appropriate logging & cleanup
closeClients("Server shutdown");
// *** do this in getSecurity instead?
const char *address = sock->getPeerAddress();
if (blHosts->isBlackmarked(address)) {
- connectionsLog.error("blacklisted: %s", address);
+ connectionsLog.error("Blacklisted: %s", address);
try {
rdr::OutStream& os = sock->outStream();
return;
}
- connectionsLog.status("accepted: %s", sock->getPeerEndpoint());
+ connectionsLog.status("Accepted: %s", sock->getPeerEndpoint());
// Adjust the exit timers
if (rfb::Server::maxConnectionTime && clients.empty())
clients.remove(*ci);
- connectionsLog.status("closed: %s", peer.c_str());
+ connectionsLog.status("Closed: %s", peer.c_str());
// - Check that the desktop object is still required
if (authClientCount() == 0)
return;
}
}
- throw std::invalid_argument("invalid Socket in VNCServerST");
+ throw std::invalid_argument("Invalid Socket in VNCServerST");
}
void VNCServerST::processSocketWriteEvent(network::Socket* sock)
return;
}
}
- throw std::invalid_argument("invalid Socket in VNCServerST");
+ throw std::invalid_argument("Invalid Socket in VNCServerST");
}
void VNCServerST::blockUpdates()
screenLayout = ScreenSet();
if (desktopStarted)
- throw std::logic_error("setPixelBuffer: null PixelBuffer when desktopStarted?");
+ throw std::logic_error("setPixelBuffer: Null PixelBuffer when desktopStarted?");
return;
}
if (!layout.validate(pb->width(), pb->height()))
- throw std::invalid_argument("setPixelBuffer: invalid screen layout");
+ throw std::invalid_argument("setPixelBuffer: Invalid screen layout");
screenLayout = layout;
void VNCServerST::setScreenLayout(const ScreenSet& layout)
{
if (!pb)
- throw std::logic_error("setScreenLayout: new screen layout without a PixelBuffer");
+ throw std::logic_error("setScreenLayout: New screen layout without a PixelBuffer");
if (!layout.validate(pb->width(), pb->height()))
- throw std::invalid_argument("setScreenLayout: invalid screen layout");
+ throw std::invalid_argument("setScreenLayout: Invalid screen layout");
screenLayout = layout;
if (rfb::Server::disconnectClients &&
client->accessCheck(AccessNonShared)) {
// - Close all the other connected clients
- slog.debug("non-shared connection - closing clients");
+ slog.debug("Non-shared connection - closing clients");
closeClients("Non-shared connection requested", client->getSock());
} else {
// - Refuse this connection if there are existing clients, in addition to
void VNCServerST::startDesktop()
{
if (!desktopStarted) {
- slog.debug("starting desktop");
+ slog.debug("Starting desktop");
desktop->start();
if (!pb)
throw std::logic_error("SDesktop::start() did not set a valid PixelBuffer");
void VNCServerST::stopDesktop()
{
if (desktopStarted) {
- slog.debug("stopping desktop");
+ slog.debug("Stopping desktop");
desktopStarted = false;
desktop->stop();
}
char buf[9];
if (len != 8)
- throw std::invalid_argument("bad obfuscated password length");
+ throw std::invalid_argument("Bad obfuscated password length");
assert(data != nullptr);