Archived
server: the worker-start failure logs its reason sanitized
The HTTP pool's start() caught std::system_error and printed e.what() raw. An OS message carries no socket bytes, but every other catch in the transport reads it through log_sanitize, and consistency is the cheap half of the guarantee: a message that ever carried a token or a control character would print straight into the operator's log. One call to log_sanitize, and every line this transport writes from a caught exception now says so through the same filter.
This commit is contained in:
1 parent
1231eefbd3
commit
e30ada33e8
1 file changed
+4
-1
@@ -432,7 +432,10 @@ private:
|
|||||||
try {
|
try {
|
||||||
threads_.emplace_back([this] { work(); });
|
threads_.emplace_back([this] { work(); });
|
||||||
} catch (const std::system_error& e) {
|
} catch (const std::system_error& e) {
|
||||||
RAD_WARN("server: cannot start an HTTP worker (%s); the connection waits", e.what());
|
/* An OS message carries no socket bytes, but it is still text this log must not
|
||||||
|
* pass through unsanitized -- every other catch here reads it through log_sanitize. */
|
||||||
|
RAD_WARN("server: cannot start an HTTP worker (%s); the connection waits",
|
||||||
|
log_sanitize(e.what()).c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
++free_;
|
++free_;
|
||||||
|
|||||||
Reference in new issue
Block a user