mirror of
https://github.com/curl/curl.git
synced 2026-07-23 21:07:17 +03:00
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!
This commit is contained in:
parent
0d9f14f5c1
commit
6a79b0e859
3 changed files with 17 additions and 3 deletions
|
|
@ -263,13 +263,19 @@ int curl_accept(int s, void *saddr, void *saddrlen,
|
|||
return sockfd;
|
||||
}
|
||||
|
||||
/* separate function to allow libcurl to mark a "faked" close */
|
||||
int curl_mark_sclose(int sockfd, int line, const char *source)
|
||||
{
|
||||
if(logfile)
|
||||
fprintf(logfile, "FD %s:%d sclose(%d)\n",
|
||||
source, line, sockfd);
|
||||
}
|
||||
|
||||
/* this is our own defined way to close sockets on *ALL* platforms */
|
||||
int curl_sclose(int sockfd, int line, const char *source)
|
||||
{
|
||||
int res=sclose(sockfd);
|
||||
if(logfile)
|
||||
fprintf(logfile, "FD %s:%d sclose(%d)\n",
|
||||
source, line, sockfd);
|
||||
curl_mark_sclose(sockfd, line, source);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue