Browse code

give "proper" status line

git-svn-id: file:///var/lib/svn/clamav-devel/branches/clamd-proto@4616 77e5149b-7576-45b1-b177-96237e5ba77b

aCaB authored on 2009/01/15 02:21:34
Showing 1 changed files
... ...
@@ -90,10 +90,10 @@ static int dsresult(int sockd, const char *scantype, const char *filename, const
90 90
 	    break;
91 91
 	}
92 92
 	while(r && (eol = memchr(pt, 0, r))) {
93
+	    logg("~%s\n", bol);
93 94
 	    if(eol-bol > 7) {
94 95
 		if(!memcmp(eol - 6, " FOUND", 6)) {
95 96
 		    infected++;
96
-		    logg("%s\n", bol);
97 97
 		    if(optget(opts, "move")->enabled || optget(opts, "copy")->enabled) {
98 98
 			char *com = strrchr(bol, ':');
99 99
 			if(com) {
... ...
@@ -112,8 +112,7 @@ static int dsresult(int sockd, const char *scantype, const char *filename, const
112 112
 			    }
113 113
 			}
114 114
 		    }
115
-		} else if(memcmp(eol-7, ": ERROR", 7)) {
116
-		    logg("~%s\n", bol);
115
+		} else if(!memcmp(eol-6, " ERROR", 6)) {
117 116
 		    waserror = 1;
118 117
 		}
119 118
 	    }
... ...
@@ -134,8 +133,7 @@ static int dsresult(int sockd, const char *scantype, const char *filename, const
134 134
 	bol = buff;
135 135
     }
136 136
 
137
-    if(!infected && !printinfected)
138
-	logg("~%s: OK\n", filename);
137
+    if(!infected && !printinfected && !waserror)
139 138
 
140 139
     return infected ? infected : (waserror ? -1 : 0);
141 140
 }