version 1.35 | | version 1.36 |
---|
| | |
| | |
/* | | /* |
* static char *rcsid_loop_c = | | * static char *rcsid_loop_c = |
* "$Id: loop.c,v 1.35 2005/12/05 23:34:04 akirschbaum Exp $"; | | * "$Id: loop.c,v 1.36 2005/12/07 18:25:56 akirschbaum Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
LOG(llevError, "accept failed: %s\n", strerror_local(errno)); | | LOG(llevError, "accept failed: %s\n", strerror_local(errno)); |
} | | } |
else { | | else { |
InitConnection(&init_sockets[newsocknum],ntohl(addr.sin_addr.s_addr)); | | char buf[MAX_BUF]; |
| | long ip; |
| | NewSocket *ns; |
| | |
| | ns = &init_sockets[newsocknum]; |
| | |
| | ip = ntohl(addr.sin_addr.s_addr); |
| | sprintf(buf, "%ld.%ld.%ld.%ld", (ip>>24)&255, (ip>>16)&255, (ip>>8)&255, ip&255); |
| | |
| | if (checkbanned(NULL, buf)) { |
| | LOG(llevInfo, "Banned host tried to connect: [%s]\n", buf); |
| | close(init_sockets[newsocknum].fd); |
| | init_sockets[newsocknum].fd = -1; |
| | } |
| | else { |
| | InitConnection(ns, buf); |
socket_info.nconns++; | | socket_info.nconns++; |
} | | } |
} | | } |
| | } |
| | |
/* Check for any exceptions/input on the sockets */ | | /* Check for any exceptions/input on the sockets */ |
if (pollret) for(i=1;i<socket_info.allocated_sockets;i++) { | | if (pollret) for(i=1;i<socket_info.allocated_sockets;i++) { |