samba-vscan/nai vscan-mcdaemon_core.c,1.1.2.3,1.1.2.4

Rainer Link <[email protected]>
Newsgroups gmane.comp.security.virus.openantivirus.cvs
Message-ID <[email protected]>
Update of /cvsroot/openantivirus/samba-vscan/nai
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21244/nai

Modified Files:
      Tag: VSCAN_0_3
	vscan-mcdaemon_core.c 
Log Message:
started some more code-reorganisation; not finished; could have
broken stuff


Index: vscan-mcdaemon_core.c
===================================================================
RCS file: /cvsroot/openantivirus/samba-vscan/nai/Attic/vscan-mcdaemon_core.c,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -d -r1.1.2.3 -r1.1.2.4
--- vscan-mcdaemon_core.c	3 Jan 2004 14:59:41 -0000	1.1.2.3
+++ vscan-mcdaemon_core.c	2 May 2004 19:45:32 -0000	1.1.2.4
@@ -26,34 +26,7 @@
 int vscan_mcdaemon_init(void)
 {
 
-	int sockfd;
-	struct sockaddr_in servaddr;
-
-	/* create socket */
-        if (( sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0 ) {
-               vscan_syslog("ERROR: can not create socket!\n");
-               return -1; 
-        }
-
-	bzero(&servaddr, sizeof(servaddr));
-        servaddr.sin_family = AF_INET;
-        servaddr.sin_port = htons(mcdaemon_port);
-
-	/* hm, inet_pton may not exist on all systems - FIXME ! */
-        if ( inet_pton(AF_INET, mcdaemon_ip, &servaddr.sin_addr) <= 0 ) {
-                vscan_syslog("ERROR: inet_pton failed!\n");
-                return -1;
-	}
-
-	/* connect to socket */
-	if ( connect(sockfd, (struct sockaddr *) &servaddr, sizeof(servaddr)) < 0 )
-        {
-                vscan_syslog("ERROR: can not connect to McDaemon!\n");
-                return -1;
-        }
-
-
-	return sockfd;
+	return vscan_init_socket_init("mcdaemon", mcdaemon_ip, mcdaemon_port); 
 
 }
 
@@ -187,9 +160,7 @@
 */
 void vscan_mcdaemon_end(int sockfd)
 {
-	/* sockfd == -1 indicates an error while connecting to socket */
-	if ( sockfd >= 0 ) {
-		close(sockfd);
-	}
+
+	vscan_socket_end(sockfd);
 
 }



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.