samba-vscan/icap vscan-icap_core.c,1.5.2.3,1.5.2.4
Rainer Link <[email protected]>
| Newsgroups | gmane.comp.security.virus.openantivirus.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/openantivirus/samba-vscan/icap
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21244/icap
Modified Files:
Tag: VSCAN_0_3
vscan-icap_core.c
Log Message:
started some more code-reorganisation; not finished; could have
broken stuff
Index: vscan-icap_core.c
===================================================================
RCS file: /cvsroot/openantivirus/samba-vscan/icap/vscan-icap_core.c,v
retrieving revision 1.5.2.3
retrieving revision 1.5.2.4
diff -u -d -r1.5.2.3 -r1.5.2.4
--- vscan-icap_core.c 3 Jan 2004 14:59:41 -0000 1.5.2.3
+++ vscan-icap_core.c 2 May 2004 19:45:31 -0000 1.5.2.4
@@ -33,34 +33,7 @@
int vscan_icap_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(icap_port);
-
- /* hm, inet_pton may not exist on all systems - FIXME ! */
- if ( inet_pton(AF_INET, icap_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 ICAP server (IP: '%s', port: '%d'!\n", icap_ip, icap_port);
- return -1;
- }
-
-
- return sockfd;
+ return vscan_inet_socket_init("ICAP server", icap_ip, icap_port);
}
@@ -307,10 +280,8 @@
*/
void vscan_icap_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