... | ... |
@@ -818,3 +818,25 @@ CLAMAPI void Scan_ReloadDatabase(void) { |
818 | 818 |
logg("^Database reload requested received while reload is pending\n"); |
819 | 819 |
InterlockedDecrement(&reload_waiters); |
820 | 820 |
} |
821 |
+ |
|
822 |
+void msg_callback(enum cl_msg severity, const char *fullmsg, const char *msg, void *ctx) |
|
823 |
+{ |
|
824 |
+ struct scan_ctx *sctx = (struct scan_ctx*)ctx; |
|
825 |
+ const void *instance = sctx ? sctx->inst : NULL; |
|
826 |
+ int fd = sctx ? sctx->entryfd : -1; |
|
827 |
+ char sv; |
|
828 |
+ switch (severity) { |
|
829 |
+ case CL_MSG_ERROR: |
|
830 |
+ sv = '!'; |
|
831 |
+ break; |
|
832 |
+ case CL_MSG_WARN: |
|
833 |
+ sv = '^'; |
|
834 |
+ break; |
|
835 |
+ default: |
|
836 |
+ sv = '*'; |
|
837 |
+ break; |
|
838 |
+ } |
|
839 |
+ |
|
840 |
+ logg("%c[LibClamAV] (instance %p, clamav context %p, fd %d): %s", |
|
841 |
+ sv, instance, sctx, fd, msg); |
|
842 |
+} |