diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-02-18 12:18:33 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-02-18 12:18:33 +0000 |
commit | f33be3c31320e4c92531be02df52800e56ab872b (patch) | |
tree | 685b2c939c2194d37f4e18b677688cb8ed155e0e /lib | |
parent | 62a12b7faf269412ac64d86df6a8d5f0541c7e13 (diff) |
Modified curl_accept() to take a 'void *' in the 2nd argument instead of
sockaddr *. This has the added benefit that source files that include
memdebug.h doesn't have to know about "sockaddr".
Diffstat (limited to 'lib')
-rw-r--r-- | lib/memdebug.c | 3 | ||||
-rw-r--r-- | lib/memdebug.h | 12 |
2 files changed, 12 insertions, 3 deletions
diff --git a/lib/memdebug.c b/lib/memdebug.c index d08de6a2d..5b7a0a611 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -208,9 +208,10 @@ int curl_socket(int domain, int type, int protocol, int line, return sockfd; } -int curl_accept(int s, struct sockaddr *addr, socklen_t *addrlen, +int curl_accept(int s, void *saddr, socklen_t *addrlen, int line, const char *source) { + struct sockaddr *addr = (struct sockaddr *)saddr; int sockfd=(accept)(s, addr, addrlen); if(logfile) fprintf(logfile, "FD %s:%d accept() = %d\n", diff --git a/lib/memdebug.h b/lib/memdebug.h index 48f487d67..825526d42 100644 --- a/lib/memdebug.h +++ b/lib/memdebug.h @@ -1,4 +1,6 @@ #ifdef CURLDEBUG +#ifndef _CURL_MEDEBUG_H +#define _CURL_MEDEBUG_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | @@ -22,6 +24,11 @@ * $Id$ ***************************************************************************/ +/* + * CAUTION: this header is designed to work when included by the app-side + * as well as the library. Do not mix with library internals! + */ + #include "setup.h" #ifdef HAVE_SYS_TYPES_H @@ -51,7 +58,7 @@ void curl_memlimit(long limit); /* file descriptor manipulators */ int curl_socket(int domain, int type, int protocol, int line , const char *); int curl_sclose(int sockfd, int, const char *source); -int curl_accept(int s, struct sockaddr *addr, socklen_t *addrlen, +int curl_accept(int s, void *addr, socklen_t *addrlen, int line, const char *source); /* FILE functions */ @@ -92,4 +99,5 @@ int curl_fclose(FILE *file, int line, const char *source); #endif /* MEMDEBUG_NODEFINES */ -#endif +#endif /* _CURL_MEDEBUG_H */ +#endif /* CURLDEBUG */ |