summaryrefslogtreecommitdiff
path: root/lib/memdebug.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2009-10-28 20:30:23 +0000
committerDaniel Stenberg <daniel@haxx.se>2009-10-28 20:30:23 +0000
commit6a79b0e8591ec94adcc49809bf1ab8cf66f1bb41 (patch)
treeb1b8b301d39caaee4e22277b84fbc52545d03b5d /lib/memdebug.h
parent0d9f14f5c17e4a3888dedbc8d568a55979fc05f0 (diff)
downloadcurl-6a79b0e8591ec94adcc49809bf1ab8cf66f1bb41.tar.gz
Since the NSS lib closes the socket the memory tracking system wrongly gets a
false positive on a leaked socket, so this introduces a way to tell the system that the socket is indeed closed without explicitly closing it!
Diffstat (limited to 'lib/memdebug.h')
-rw-r--r--lib/memdebug.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/memdebug.h b/lib/memdebug.h
index 6e7e8d7f2..57e89b1d4 100644
--- a/lib/memdebug.h
+++ b/lib/memdebug.h
@@ -57,6 +57,7 @@ CURL_EXTERN void curl_memlimit(long limit);
/* file descriptor manipulators */
CURL_EXTERN int curl_socket(int domain, int type, int protocol, int line , const char *);
+CURL_EXTERN int curl_mark_sclose(int sockfd, int, const char *source);
CURL_EXTERN int curl_sclose(int sockfd, int, const char *source);
CURL_EXTERN int curl_accept(int s, void *addr, void *addrlen,
int line, const char *source);
@@ -117,6 +118,8 @@ CURL_EXTERN int curl_fclose(FILE *file, int line, const char *source);
#undef sclose
#define sclose(sockfd) curl_sclose(sockfd,__LINE__,__FILE__)
+#define fake_sclose(sockfd) curl_mark_sclose(sockfd,__LINE__,__FILE__)
+
#undef fopen
#define fopen(file,mode) curl_fopen(file,mode,__LINE__,__FILE__)
#undef fdopen
@@ -127,3 +130,7 @@ CURL_EXTERN int curl_fclose(FILE *file, int line, const char *source);
#endif /* _CURL_MEMDEBUG_H */
#endif /* CURLDEBUG */
+
+#ifndef fake_sclose
+#define fake_sclose(x)
+#endif