Browse code

better handling of HTTP headers and body

git-svn: trunk@2917

Nigel Horne authored on 2007/03/08 08:30:38
Showing 2 changed files
... ...
@@ -1,3 +1,8 @@
1
+Wed Mar  7 21:35:21 GMT 2007 (njh)
2
+----------------------------------
3
+  * libclamav/mbox.c:	mail-follow-urls: handle HTTP headers and body being
4
+				received in separate packets
5
+
1 6
 Tue Mar  6 22:24:37 CET 2007 (tk)
2 7
 ---------------------------------
3 8
   * libclamav/readdb.c: load daily.cfg before any other files (when loading
... ...
@@ -4370,7 +4370,6 @@ getURL(struct arg *arg)
4370 4370
 #else
4371 4371
 	int sd;
4372 4372
 #endif
4373
-	int n;
4374 4373
 	struct sockaddr_in server;
4375 4374
 #ifdef	HAVE_IN_ADDR_T
4376 4375
 	in_addr_t ip;
... ...
@@ -4555,6 +4554,7 @@ getURL(struct arg *arg)
4555 4555
 	for(;;) {
4556 4556
 		fd_set set;
4557 4557
 		struct timeval tv;
4558
+		int n;
4558 4559
 
4559 4560
 		FD_ZERO(&set);
4560 4561
 		FD_SET(sd, &set);
... ...
@@ -4641,7 +4641,7 @@ getURL(struct arg *arg)
4641 4641
 		} else
4642 4642
 			ptr = buf;
4643 4643
 
4644
-		if(fwrite(ptr, n, 1, fp) != 1) {
4644
+		if(n && (fwrite(ptr, n, 1, fp) != 1)) {
4645 4645
 			cli_warnmsg("Error writing %d bytes to %s\n",
4646 4646
 				n, fout);
4647 4647
 			break;