diff options
author | rans | 2004-08-31 13:56:24 +0000 |
---|---|---|
committer | rans | 2004-08-31 13:56:24 +0000 |
commit | f1718d6f7e3430dd232bc63ba376570cb5253b2e (patch) | |
tree | 5d9bcfcf8b566b04be32174bd3aa113a6c9ac643 | |
parent | dcdd7d430fb8dbd2c231ab66ed6c3ac9e5721e2c (diff) | |
download | csoap-f1718d6f7e3430dd232bc63ba376570cb5253b2e.tar.gz csoap-f1718d6f7e3430dd232bc63ba376570cb5253b2e.tar.bz2 |
Removed hsocket_accept function
-rw-r--r-- | nanohttp/nanohttp-socket.c | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/nanohttp/nanohttp-socket.c b/nanohttp/nanohttp-socket.c index 7aeacbc..12aee6f 100644 --- a/nanohttp/nanohttp-socket.c +++ b/nanohttp/nanohttp-socket.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: nanohttp-socket.c,v 1.11 2004/08/30 15:26:53 snowdrop Exp $ +* $Id: nanohttp-socket.c,v 1.12 2004/08/31 13:56:24 rans Exp $ * * CSOAP Project: A http client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -29,7 +29,6 @@ #include <winsock2.h> #define close(s) closesocket(s) typedef int ssize_t; -typedef int socklen_t; #endif #ifdef HAVE_CONFIG_H @@ -188,48 +187,6 @@ int hsocket_listen(hsocket_t sock, int n) return HSOCKET_OK; } - -/*-------------------------------------------------- -FUNCTION: hsocket_listen -----------------------------------------------------*/ -int hsocket_accept(hsocket_t sock, hsocket_t *dest) -{ - socklen_t asize; - hsocket_t sockfd; - struct sockaddr_in addr; - - asize = sizeof(struct sockaddr_in); -#ifdef WIN32 - while(1) - { - sockfd = accept(sock, (struct sockaddr *)&addr, &asize); - if (sockfd == INVALID_SOCKET)
- { - if(WSAGetLastError()!=WSAEWOULDBLOCK) - { - return HSOCKET_CAN_NOT_ACCEPT; - } - } - else - { - break; - } - } -#else - sockfd = accept(sock, (struct sockaddr *)&addr, &asize); - if (sockfd == -1) { - //httpd_log("httpd_run(): '%s'\n", strerror(errno)); - return HSOCKET_CAN_NOT_ACCEPT; - } -#endif - log_verbose3("accept new socket (%d) from '%s'", sockfd, - SAVE_STR(((char*)inet_ntoa(addr.sin_addr))) ); - - *dest = sockfd; - return HSOCKET_OK; -} - - /*-------------------------------------------------- FUNCTION: hsocket_close ----------------------------------------------------*/ |