diff options
| -rw-r--r-- | apt-pkg/acquire-worker.cc | 5 | ||||
| -rw-r--r-- | methods/aptmethod.h | 12 |
2 files changed, 15 insertions, 2 deletions
diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index 4f247cf84..696a3e0b8 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -200,6 +200,7 @@ enum class APT_HIDDEN MessageType STATUS = 102, REDIRECT = 103, WARNING = 104, + AUDIT = 105, URI_START = 200, URI_DONE = 201, AUX_REQUEST = 351, @@ -388,6 +389,10 @@ bool pkgAcquire::Worker::RunMessages() _error->Warning("%s: %s", Itm ? Itm->Owner ? Itm->Owner->DescURI().c_str() : Access.c_str() : Access.c_str(), LookupTag(Message, "Message").c_str()); break; + case MessageType::AUDIT: + _error->Audit("%s: %s", Itm ? Itm->Owner ? Itm->Owner->DescURI().c_str() : Access.c_str() : Access.c_str(), LookupTag(Message, "Message").c_str()); + break; + case MessageType::URI_START: { if (Itm == nullptr) diff --git a/methods/aptmethod.h b/methods/aptmethod.h index 26b8c0b55..1c24f3a98 100644 --- a/methods/aptmethod.h +++ b/methods/aptmethod.h @@ -448,7 +448,7 @@ protected: return true; } - void Warning(std::string &&msg) + void Message(std::string &&msg, std::string code) { std::unordered_map<std::string, std::string> fields; if (Queue != 0) @@ -458,7 +458,15 @@ protected: if (not UsedMirror.empty()) fields.emplace("UsedMirror", UsedMirror); fields.emplace("Message", std::move(msg)); - SendMessage("104 Warning", std::move(fields)); + SendMessage(code, std::move(fields)); + } + void Warning(std::string &&msg) + { + return Message(std::move(msg), "104 Warning"); + } + void Audit(std::string &&msg) + { + return Message(std::move(msg), "105 Audit"); } bool TransferModificationTimes(char const * const From, char const * const To, time_t &LastModified) APT_NONNULL(2, 3) |
