Skip to content

Commit df22c65

Browse files
committed
Capitalize first letter in log, exception & error
1 parent 3df8be0 commit df22c65

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+212
-212
lines changed

common/network/TcpSocket.cxx

+12-12
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ const char* TcpSocket::getPeerAddress() {
217217
socklen_t sa_size = sizeof(sa);
218218

219219
if (getpeername(getFd(), &sa.u.sa, &sa_size) != 0) {
220-
vlog.error("unable to get peer name for socket");
220+
vlog.error("Unable to get peer name for socket");
221221
return "(N/A)";
222222
}
223223

@@ -231,7 +231,7 @@ const char* TcpSocket::getPeerAddress() {
231231
buffer + 1, sizeof(buffer) - 2, nullptr, 0,
232232
NI_NUMERICHOST);
233233
if (ret != 0) {
234-
vlog.error("unable to convert peer name to a string");
234+
vlog.error("Unable to convert peer name to a string");
235235
return "(N/A)";
236236
}
237237

@@ -245,14 +245,14 @@ const char* TcpSocket::getPeerAddress() {
245245

246246
name = inet_ntoa(sa.u.sin.sin_addr);
247247
if (name == nullptr) {
248-
vlog.error("unable to convert peer name to a string");
248+
vlog.error("Unable to convert peer name to a string");
249249
return "(N/A)";
250250
}
251251

252252
return name;
253253
}
254254

255-
vlog.error("unknown address family for socket");
255+
vlog.error("Unknown address family for socket");
256256
return "";
257257
}
258258

@@ -281,7 +281,7 @@ bool TcpSocket::enableNagles(bool enable) {
281281
if (setsockopt(getFd(), IPPROTO_TCP, TCP_NODELAY,
282282
(char *)&one, sizeof(one)) < 0) {
283283
int e = errorNumber;
284-
vlog.error("unable to setsockopt TCP_NODELAY: %d", e);
284+
vlog.error("Unable to setsockopt TCP_NODELAY: %d", e);
285285
return false;
286286
}
287287
return true;
@@ -299,15 +299,15 @@ TcpListener::TcpListener(const struct sockaddr *listenaddr,
299299
int sock;
300300

301301
if ((sock = socket (listenaddr->sa_family, SOCK_STREAM, 0)) < 0)
302-
throw SocketException("unable to create listening socket", errorNumber);
302+
throw SocketException("Unable to create listening socket", errorNumber);
303303

304304
memcpy (&sa, listenaddr, listenaddrlen);
305305
#ifdef IPV6_V6ONLY
306306
if (listenaddr->sa_family == AF_INET6) {
307307
if (setsockopt (sock, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&one, sizeof(one))) {
308308
int e = errorNumber;
309309
closesocket(sock);
310-
throw SocketException("unable to set IPV6_V6ONLY", e);
310+
throw SocketException("Unable to set IPV6_V6ONLY", e);
311311
}
312312
}
313313
#endif /* defined(IPV6_V6ONLY) */
@@ -325,14 +325,14 @@ TcpListener::TcpListener(const struct sockaddr *listenaddr,
325325
(char *)&one, sizeof(one)) < 0) {
326326
int e = errorNumber;
327327
closesocket(sock);
328-
throw SocketException("unable to create listening socket", e);
328+
throw SocketException("Unable to create listening socket", e);
329329
}
330330
#endif
331331

332332
if (bind(sock, &sa.u.sa, listenaddrlen) == -1) {
333333
int e = errorNumber;
334334
closesocket(sock);
335-
throw SocketException("failed to bind socket", e);
335+
throw SocketException("Failed to bind socket", e);
336336
}
337337

338338
listen(sock);
@@ -443,7 +443,7 @@ void network::createTcpListeners(std::list<SocketListener*> *listeners,
443443
snprintf (service, sizeof (service) - 1, "%d", port);
444444
service[sizeof (service) - 1] = '\0';
445445
if ((result = getaddrinfo(addr, service, &hints, &ai)) != 0)
446-
throw GAIException("unable to resolve listening address", result);
446+
throw GAIException("Unable to resolve listening address", result);
447447

448448
try {
449449
createTcpListeners(listeners, ai);
@@ -630,7 +630,7 @@ TcpFilter::Pattern TcpFilter::parsePattern(const char* p) {
630630
}
631631

632632
if ((result = getaddrinfo (parts[0].c_str(), nullptr, &hints, &ai)) != 0) {
633-
throw GAIException("unable to resolve host by name", result);
633+
throw GAIException("Unable to resolve host by name", result);
634634
}
635635

636636
memcpy (&pattern.address.u.sa, ai->ai_addr, ai->ai_addrlen);
@@ -641,7 +641,7 @@ TcpFilter::Pattern TcpFilter::parsePattern(const char* p) {
641641
if (parts.size() > 1) {
642642
if (family == AF_INET &&
643643
(parts[1].find('.') != std::string::npos)) {
644-
throw Exception("mask no longer supported for filter, "
644+
throw Exception("Mask no longer supported for filter, "
645645
"use prefix instead");
646646
}
647647

common/network/UnixSocket.cxx

+6-6
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ UnixSocket::UnixSocket(const char *path)
6969
}
7070

7171
if (result == -1)
72-
throw SocketException("unable to connect to socket", err);
72+
throw SocketException("Unable to connect to socket", err);
7373

7474
setFd(sock);
7575
}
@@ -84,7 +84,7 @@ const char* UnixSocket::getPeerAddress() {
8484

8585
salen = sizeof(addr);
8686
if (getpeername(getFd(), (struct sockaddr *)&addr, &salen) != 0) {
87-
vlog.error("unable to get peer name for socket");
87+
vlog.error("Unable to get peer name for socket");
8888
return "";
8989
}
9090

@@ -93,7 +93,7 @@ const char* UnixSocket::getPeerAddress() {
9393

9494
salen = sizeof(addr);
9595
if (getsockname(getFd(), (struct sockaddr *)&addr, &salen) != 0) {
96-
vlog.error("unable to get local name for socket");
96+
vlog.error("Unable to get local name for socket");
9797
return "";
9898
}
9999

@@ -120,7 +120,7 @@ UnixListener::UnixListener(const char *path, int mode)
120120

121121
// - Create a socket
122122
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
123-
throw SocketException("unable to create listening socket", errno);
123+
throw SocketException("Unable to create listening socket", errno);
124124

125125
// - Delete existing socket (ignore result)
126126
unlink(path);
@@ -135,14 +135,14 @@ UnixListener::UnixListener(const char *path, int mode)
135135
umask(saved_umask);
136136
if (result < 0) {
137137
close(fd);
138-
throw SocketException("unable to bind listening socket", err);
138+
throw SocketException("Unable to bind listening socket", err);
139139
}
140140

141141
// - Set socket mode
142142
if (chmod(path, mode) < 0) {
143143
err = errno;
144144
close(fd);
145-
throw SocketException("unable to set socket mode", err);
145+
throw SocketException("Unable to set socket mode", err);
146146
}
147147

148148
listen(fd);

common/rdr/RandomStream.cxx

+5-5
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ RandomStream::RandomStream()
5050
if (GetLastError() == (DWORD)NTE_BAD_KEYSET) {
5151
if (!CryptAcquireContext(&provider, nullptr, nullptr,
5252
PROV_RSA_FULL, CRYPT_NEWKEYSET)) {
53-
vlog.error("unable to create keyset");
53+
vlog.error("Unable to create keyset");
5454
provider = 0;
5555
}
5656
} else {
57-
vlog.error("unable to acquire context");
57+
vlog.error("Unable to acquire context");
5858
provider = 0;
5959
}
6060
}
@@ -69,7 +69,7 @@ RandomStream::RandomStream()
6969
{
7070
#endif
7171
#endif
72-
vlog.error("no OS supplied random source - using rand()");
72+
vlog.error("No OS supplied random source: Using rand()");
7373
seed += (unsigned int) time(nullptr) + getpid() + getpid() * 987654 + rand();
7474
srand(seed);
7575
}
@@ -89,15 +89,15 @@ bool RandomStream::fillBuffer() {
8989
#ifdef RFB_HAVE_WINCRYPT
9090
if (provider) {
9191
if (!CryptGenRandom(provider, availSpace(), (uint8_t*)end))
92-
throw rdr::Win32Exception("unable to CryptGenRandom", GetLastError());
92+
throw rdr::Win32Exception("Unable to CryptGenRandom", GetLastError());
9393
end += availSpace();
9494
} else {
9595
#else
9696
#ifndef WIN32
9797
if (fp) {
9898
size_t n = fread((uint8_t*)end, 1, availSpace(), fp);
9999
if (n <= 0)
100-
throw rdr::PosixException("reading /dev/urandom or /dev/random failed",
100+
throw rdr::PosixException("Reading /dev/urandom or /dev/random failed",
101101
errno);
102102
end += n;
103103
} else {

common/rdr/ZlibOutStream.cxx

+4-4
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ bool ZlibOutStream::flushBuffer()
9797
zs->avail_in = ptr - sentUpTo;
9898

9999
#ifdef ZLIBOUT_DEBUG
100-
vlog.debug("flush: avail_in %d",zs->avail_in);
100+
vlog.debug("Flush: avail_in %d",zs->avail_in);
101101
#endif
102102

103103
// Force out everything from the zlib encoder
@@ -124,7 +124,7 @@ void ZlibOutStream::deflate(int flush)
124124
zs->avail_out = chunk = underlying->avail();
125125

126126
#ifdef ZLIBOUT_DEBUG
127-
vlog.debug("calling deflate, avail_in %d, avail_out %d",
127+
vlog.debug("Calling deflate, avail_in %d, avail_out %d",
128128
zs->avail_in,zs->avail_out);
129129
#endif
130130

@@ -138,7 +138,7 @@ void ZlibOutStream::deflate(int flush)
138138
}
139139

140140
#ifdef ZLIBOUT_DEBUG
141-
vlog.debug("after deflate: %d bytes",
141+
vlog.debug("After deflate: %d bytes",
142142
zs->next_out-underlying->getptr());
143143
#endif
144144

@@ -152,7 +152,7 @@ void ZlibOutStream::checkCompressionLevel()
152152

153153
if (newLevel != compressionLevel) {
154154
#ifdef ZLIBOUT_DEBUG
155-
vlog.debug("change: avail_in %d",zs->avail_in);
155+
vlog.debug("Change: avail_in %d",zs->avail_in);
156156
#endif
157157

158158
// zlib is just horribly stupid. It does an implicit flush on

common/rfb/CConnection.cxx

+9-9
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ bool CConnection::processVersionMsg()
161161
int majorVersion;
162162
int minorVersion;
163163

164-
vlog.debug("reading protocol version");
164+
vlog.debug("Reading protocol version");
165165

166166
if (!is->hasData(12))
167167
return false;
@@ -209,7 +209,7 @@ bool CConnection::processVersionMsg()
209209

210210
bool CConnection::processSecurityTypesMsg()
211211
{
212-
vlog.debug("processing security types message");
212+
vlog.debug("Processing security types message");
213213

214214
int secType = secTypeInvalid;
215215

@@ -294,7 +294,7 @@ bool CConnection::processSecurityTypesMsg()
294294

295295
bool CConnection::processSecurityMsg()
296296
{
297-
vlog.debug("processing security message");
297+
vlog.debug("Processing security message");
298298
if (!csecurity->processMsg())
299299
return false;
300300

@@ -305,7 +305,7 @@ bool CConnection::processSecurityMsg()
305305

306306
bool CConnection::processSecurityResultMsg()
307307
{
308-
vlog.debug("processing security result message");
308+
vlog.debug("Processing security result message");
309309
int result;
310310

311311
if (server.beforeVersion(3,8) && csecurity->getType() == secTypeNone) {
@@ -321,10 +321,10 @@ bool CConnection::processSecurityResultMsg()
321321
securityCompleted();
322322
return true;
323323
case secResultFailed:
324-
vlog.debug("auth failed");
324+
vlog.debug("Auth failed");
325325
break;
326326
case secResultTooMany:
327-
vlog.debug("auth failed - too many tries");
327+
vlog.debug("Auth failed: Too many tries");
328328
break;
329329
default:
330330
throw Exception("Unknown security result from server");
@@ -341,7 +341,7 @@ bool CConnection::processSecurityResultMsg()
341341

342342
bool CConnection::processSecurityReasonMsg()
343343
{
344-
vlog.debug("processing security reason message");
344+
vlog.debug("Processing security reason message");
345345

346346
if (!is->hasData(4))
347347
return false;
@@ -363,7 +363,7 @@ bool CConnection::processSecurityReasonMsg()
363363

364364
bool CConnection::processInitMsg()
365365
{
366-
vlog.debug("reading server initialisation");
366+
vlog.debug("Reading server initialisation");
367367
return reader_->readServerInit();
368368
}
369369

@@ -460,7 +460,7 @@ void CConnection::serverInit(int width, int height,
460460
CMsgHandler::serverInit(width, height, pf, name);
461461

462462
state_ = RFBSTATE_NORMAL;
463-
vlog.debug("initialisation done");
463+
vlog.debug("Initialisation done");
464464

465465
initDone();
466466
assert(framebuffer != nullptr);

common/rfb/CMsgReader.cxx

+2-2
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ bool CMsgReader::readServerCutText()
277277

278278
if (len > (size_t)maxCutText) {
279279
is->skip(len);
280-
vlog.error("cut text too long (%d bytes) - ignoring",len);
280+
vlog.error("Cut text too long (%d bytes) - ignoring",len);
281281
return true;
282282
}
283283

@@ -477,7 +477,7 @@ bool CMsgReader::readRect(const Rect& r, int encoding)
477477
}
478478

479479
if (r.is_empty())
480-
vlog.error("zero size rect");
480+
vlog.error("Zero size rect");
481481

482482
return handler->dataRect(r, encoding);
483483
}

common/rfb/CSecurityTLS.cxx

+2-2
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,11 @@ void CSecurityTLS::checkSession()
316316
return;
317317

318318
if (gnutls_certificate_type_get(session) != GNUTLS_CRT_X509)
319-
throw Exception("unsupported certificate type");
319+
throw Exception("Unsupported certificate type");
320320

321321
err = gnutls_certificate_verify_peers2(session, &status);
322322
if (err != 0) {
323-
vlog.error("server certificate verification failed: %s", gnutls_strerror(err));
323+
vlog.error("Server certificate verification failed: %s", gnutls_strerror(err));
324324
throw rdr::TLSException("server certificate verification()", err);
325325
}
326326

common/rfb/Configuration.cxx

+6-6
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ bool VoidParameter::isBool() const {
236236

237237
void
238238
VoidParameter::setImmutable() {
239-
vlog.debug("set immutable %s", getName());
239+
vlog.debug("Set immutable %s", getName());
240240
immutable = true;
241241
}
242242

@@ -270,7 +270,7 @@ bool AliasParameter::isBool() const {
270270

271271
void
272272
AliasParameter::setImmutable() {
273-
vlog.debug("set immutable %s (Alias)", getName());
273+
vlog.debug("Set immutable %s (Alias)", getName());
274274
param->setImmutable();
275275
}
276276

@@ -308,7 +308,7 @@ bool BoolParameter::setParam() {
308308
void BoolParameter::setParam(bool b) {
309309
if (immutable) return;
310310
value = b;
311-
vlog.debug("set %s(Bool) to %d", getName(), value);
311+
vlog.debug("Set %s(Bool) to %d", getName(), value);
312312
}
313313

314314
std::string BoolParameter::getDefaultStr() const {
@@ -345,7 +345,7 @@ IntParameter::setParam(const char* v) {
345345
bool
346346
IntParameter::setParam(int v) {
347347
if (immutable) return true;
348-
vlog.debug("set %s(Int) to %d", getName(), v);
348+
vlog.debug("Set %s(Int) to %d", getName(), v);
349349
if (v < minValue || v > maxValue)
350350
return false;
351351
value = v;
@@ -388,7 +388,7 @@ bool StringParameter::setParam(const char* v) {
388388
if (immutable) return true;
389389
if (!v)
390390
throw rfb::Exception("setParam(<null>) not allowed");
391-
vlog.debug("set %s(String) to %s", getName(), v);
391+
vlog.debug("Set %s(String) to %s", getName(), v);
392392
value = v;
393393
return true;
394394
}
@@ -439,7 +439,7 @@ bool BinaryParameter::setParam(const char* v) {
439439
void BinaryParameter::setParam(const uint8_t* v, size_t len) {
440440
LOCK_CONFIG;
441441
if (immutable) return;
442-
vlog.debug("set %s(Binary)", getName());
442+
vlog.debug("Set %s(Binary)", getName());
443443
delete [] value;
444444
value = nullptr;
445445
length = 0;

0 commit comments

Comments
 (0)