Browse code

picked on the wrong sz

git-svn: trunk@4786

aCaB authored on 2009/02/14 17:49:07
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Sat Feb 14 10:17:37 CET 2009 (acab)
2
+-----------------------------------
3
+ * clamav-milter/clamfi.c: Revert previous and add a better fix
4
+
1 5
 Sat Feb 14 09:34:18 CET 2009 (acab)
2 6
 -----------------------------------
3 7
  * clamav-milter/clamfi.c: Correctly scan in FILDES mode
... ...
@@ -79,8 +79,8 @@ static sfsistat sendchunk(struct CLAMFI *cf, unsigned char *bodyp, size_t len, S
79 79
     if(cf->totsz + len > maxfilesize)
80 80
 	len = maxfilesize - cf->totsz;
81 81
 
82
+    cf->totsz += len;
82 83
     if(cf->local) {
83
-	cf->bufsz += len;
84 84
 	while(len) {
85 85
 	    int n = write(cf->alt, bodyp, len);
86 86
 
... ...
@@ -120,7 +120,6 @@ static sfsistat sendchunk(struct CLAMFI *cf, unsigned char *bodyp, size_t len, S
120 120
 	    return FailAction;
121 121
 	}
122 122
     }
123
-    cf->totsz += len;
124 123
     return SMFIS_CONTINUE;
125 124
 }
126 125
 
... ...
@@ -132,7 +131,7 @@ sfsistat clamfi_header(SMFICTX *ctx, char *headerf, char *headerv) {
132 132
     if(!(cf = (struct CLAMFI *)smfi_getpriv(ctx)))
133 133
 	return SMFIS_CONTINUE; /* whatever */
134 134
 
135
-    if(!cf->bufsz) {
135
+    if(!cf->totsz) {
136 136
 	if(cf->all_whitelisted) {
137 137
 	    logg("*Skipping scan (all destinations whitelisted)\n");
138 138
 	    smfi_setpriv(ctx, NULL);