int len;
unsigned int len;
int do_accept(int acc_sock, int *sock, char **host)	{	int ret,i;	struct hostent *h1,*h2;	static struct sockaddr_in from;	int len;/*	struct linger ling; */	if (!sock_init()) return(0);#ifndef WINDOWSredoit:#endif	memset((char *)&from,0,sizeof(from));	len=sizeof(from);	ret=accept(acc_sock,(struct sockaddr *)&from,&len);	if (ret == INVALID_SOCKET)		{#ifdef WINDOWS		i=WSAGetLastError();		BIO_printf(bio_err,"accept error %d\n",i);#else		if (errno == EINTR)			{			/*check_timeout(); */			goto redoit;			}		fprintf(stderr,"errno=%d ",errno);		perror("accept");#endif		return(0);		}/*	ling.l_onoff=1;	ling.l_linger=0;	i=setsockopt(ret,SOL_SOCKET,SO_LINGER,(char *)&ling,sizeof(ling));	if (i < 0) { perror("linger"); return(0); }	i=0;	i=setsockopt(ret,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i));	if (i < 0) { perror("keepalive"); return(0); }*/	if (host == NULL) goto end;#ifndef BIT_FIELD_LIMITS	/* I should use WSAAsyncGetHostByName() under windows */	h1=gethostbyaddr((char *)&from.sin_addr.s_addr,		sizeof(from.sin_addr.s_addr),AF_INET);#else	h1=gethostbyaddr((char *)&from.sin_addr,		sizeof(struct in_addr),AF_INET);#endif	if (h1 == NULL)		{		BIO_printf(bio_err,"bad gethostbyaddr\n");		*host=NULL;		/* return(0); */		}	else		{		if ((*host=(char *)Malloc(strlen(h1->h_name)+1)) == NULL)			{			perror("Malloc");			return(0);			}		strcpy(*host,h1->h_name);		h2=GetHostByName(*host);		if (h2 == NULL)			{			BIO_printf(bio_err,"gethostbyname failure\n");			return(0);			}		i=0;		if (h2->h_addrtype != AF_INET)			{			BIO_printf(bio_err,"gethostbyname addr is not AF_INET\n");			return(0);			}		}end:	*sock=ret;	return(1);	}