Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
0b454311
Commit
0b454311
authored
19 years ago
by
Gisle Vanem
Browse files
Options
Downloads
Patches
Plain Diff
hostthre.c: destroy_thread_data() made public. Called
from url.c: Curl_disconnect().
parent
5d134903
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/hostip.h
+6
-0
6 additions, 0 deletions
lib/hostip.h
lib/hostthre.c
+8
-7
8 additions, 7 deletions
lib/hostthre.c
lib/url.c
+4
-3
4 additions, 3 deletions
lib/url.c
with
18 additions
and
10 deletions
lib/hostip.h
+
6
−
0
View file @
0b454311
...
...
@@ -240,6 +240,12 @@ struct Curl_dns_entry *
Curl_cache_addr
(
struct
SessionHandle
*
data
,
Curl_addrinfo
*
addr
,
char
*
hostname
,
int
port
);
/*
* Curl_destroy_thread_data() cleans up async resolver data.
* Complementary of ares_destroy.
*/
void
Curl_destroy_thread_data
(
struct
Curl_async
*
async
);
#ifndef INADDR_NONE
#define CURL_INADDR_NONE (in_addr_t) ~0
#else
...
...
This diff is collapsed.
Click to expand it.
lib/hostthre.c
+
8
−
7
View file @
0b454311
...
...
@@ -301,10 +301,10 @@ static unsigned __stdcall getaddrinfo_thread (void *arg)
#endif
/*
* destroy_thread_data() cleans up async resolver data.
*
Curl_
destroy_thread_data() cleans up async resolver data.
* Complementary of ares_destroy.
*/
static
void
destroy_thread_data
(
struct
Curl_async
*
async
)
void
Curl_
destroy_thread_data
(
struct
Curl_async
*
async
)
{
if
(
async
->
hostname
)
free
(
async
->
hostname
);
...
...
@@ -319,6 +319,7 @@ static void destroy_thread_data (struct Curl_async *async)
/* destroy the synchronization objects */
if
(
td
->
mutex_waiting
)
CloseHandle
(
td
->
mutex_waiting
);
td
->
mutex_waiting
=
NULL
;
if
(
td
->
event_resolved
)
CloseHandle
(
td
->
event_resolved
);
...
...
@@ -365,7 +366,7 @@ static bool init_resolve_thread (struct connectdata *conn,
*/
td
->
mutex_waiting
=
CreateMutex
(
NULL
,
TRUE
,
NULL
);
if
(
td
->
mutex_waiting
==
NULL
)
{
destroy_thread_data
(
&
conn
->
async
);
Curl_
destroy_thread_data
(
&
conn
->
async
);
SetLastError
(
EAGAIN
);
return
FALSE
;
}
...
...
@@ -375,7 +376,7 @@ static bool init_resolve_thread (struct connectdata *conn,
*/
td
->
event_resolved
=
CreateEvent
(
NULL
,
TRUE
,
FALSE
,
NULL
);
if
(
td
->
event_resolved
==
NULL
)
{
destroy_thread_data
(
&
conn
->
async
);
Curl_
destroy_thread_data
(
&
conn
->
async
);
SetLastError
(
EAGAIN
);
return
FALSE
;
}
...
...
@@ -401,7 +402,7 @@ static bool init_resolve_thread (struct connectdata *conn,
if
(
!
td
->
thread_hnd
)
{
SetLastError
(
errno
);
TRACE
((
"_beginthreadex() failed; %s
\n
"
,
Curl_strerror
(
conn
,
errno
)));
destroy_thread_data
(
&
conn
->
async
);
Curl_
destroy_thread_data
(
&
conn
->
async
);
return
FALSE
;
}
/* This socket is only to keep Curl_resolv_fdset() and select() happy;
...
...
@@ -508,7 +509,7 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn,
rc
=
CURLE_OPERATION_TIMEDOUT
;
}
destroy_thread_data
(
&
conn
->
async
);
Curl_
destroy_thread_data
(
&
conn
->
async
);
if
(
!
conn
->
async
.
dns
)
conn
->
bits
.
close
=
TRUE
;
...
...
@@ -528,7 +529,7 @@ CURLcode Curl_is_resolved(struct connectdata *conn,
if
(
conn
->
async
.
done
)
{
/* we're done */
destroy_thread_data
(
&
conn
->
async
);
Curl_
destroy_thread_data
(
&
conn
->
async
);
if
(
!
conn
->
async
.
dns
)
{
TRACE
((
"Curl_is_resolved(): CURLE_COULDNT_RESOLVE_HOST
\n
"
));
return
CURLE_COULDNT_RESOLVE_HOST
;
...
...
This diff is collapsed.
Click to expand it.
lib/url.c
+
4
−
3
View file @
0b454311
...
...
@@ -1503,11 +1503,12 @@ CURLcode Curl_disconnect(struct connectdata *conn)
Curl_safefree
(
conn
->
allocptr
.
cookiehost
);
Curl_safefree
(
conn
->
ip_addr_str
);
#if defined(USE_ARES) || defined(USE_THREADING_GETHOSTBYNAME) || \
defined(USE_THREADING_GETADDRINFO)
/* possible left-overs from the async name resolve */
/* possible left-overs from the async name resolvers */
#if defined(USE_ARES)
Curl_safefree
(
conn
->
async
.
hostname
);
Curl_safefree
(
conn
->
async
.
os_specific
);
#elif defined(CURLRES_THREADED)
Curl_destroy_thread_data
(
&
conn
->
async
);
#endif
Curl_free_ssl_config
(
&
conn
->
ssl_config
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment