]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/base/AsyncJob.cc
Source Format Enforcement (#763)
[thirdparty/squid.git] / src / base / AsyncJob.cc
index 29286a91b50960764a8d27b7f0d63cd934e7bd82..f025c039421783f7d07ac60e7559490609091de3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
  *
  * Squid software is distributed under GPLv2+ license and includes
  * contributions from numerous individuals and organizations.
@@ -28,7 +28,7 @@ AsyncJob::Pointer AsyncJob::Start(AsyncJob *j)
 }
 
 AsyncJob::AsyncJob(const char *aTypeName) :
-        stopReason(NULL), typeName(aTypeName), inCall(NULL)
+    stopReason(NULL), typeName(aTypeName), inCall(NULL)
 {
     debugs(93,5, "AsyncJob constructed, this=" << this <<
            " type=" << typeName << " [" << id << ']');
@@ -104,7 +104,7 @@ bool AsyncJob::canBeCalled(AsyncCall &call) const
         // This may happen when we have bugs or some module is not calling
         // us asynchronously (comm used to do that).
         debugs(93, 5, HERE << inCall << " is in progress; " <<
-               call << " canot reenter the job.");
+               call << " cannot reenter the job.");
         return call.cancel("reentrant job call");
     }
 
@@ -123,8 +123,10 @@ void AsyncJob::callStart(AsyncCall &call)
            typeName << " status in:" << status());
 }
 
-void AsyncJob::callException(const std::exception &e)
+void
+AsyncJob::callException(const std::exception &ex)
 {
+    debugs(93, 2, ex.what());
     // we must be called asynchronously and hence, the caller must lock us
     Must(cbdataReferenceValid(toCbdata()));
 
@@ -161,10 +163,9 @@ const char *AsyncJob::status() const
 
     buf.append(" [", 2);
     if (stopReason != NULL) {
-        buf.Printf("Stopped, reason:");
-        buf.Printf("%s",stopReason);
+        buf.appendf("Stopped, reason:%s", stopReason);
     }
-    buf.Printf(" %s%u]", id.Prefix, id.value);
+    buf.appendf(" %s%u]", id.prefix(), id.value);
     buf.terminate();
 
     return buf.content();