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
31a693b9
Commit
31a693b9
authored
20 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
Gisle Vanem's fix that makes the multi interface work on Windows again even
when not using ares.
parent
804534fb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/hostip.c
+28
-7
28 additions, 7 deletions
lib/hostip.c
with
28 additions
and
7 deletions
lib/hostip.c
+
28
−
7
View file @
31a693b9
...
...
@@ -137,6 +137,7 @@ struct thread_data {
HANDLE
thread_hnd
;
unsigned
thread_id
;
DWORD
thread_status
;
curl_socket_t
dummy_sock
;
/* dummy for Curl_multi_ares_fdset() */
};
#endif
...
...
@@ -807,23 +808,31 @@ CURLcode Curl_is_resolved(struct connectdata *conn,
#if !defined(USE_ARES)
/*
* Non-ares build.
*
* We provide this function only to allow multi.c to remain unaware if we are
* doing asynch resolves or not.
* Non-ares build. If we are using threading gethostbyname, then this must
* set the fd_set for the threaded resolve socket. If not, we just return OK.
*/
CURLcode
Curl_multi_ares_fdset
(
struct
connectdata
*
conn
,
fd_set
*
read_fd_set
,
fd_set
*
write_fd_set
,
int
*
max_fdp
)
{
#ifdef USE_THREADING_GETHOSTBYNAME
const
struct
thread_data
*
td
=
(
const
struct
thread_data
*
)
conn
->
async
.
os_specific
;
if
(
td
&&
td
->
dummy_sock
!=
CURL_SOCKET_BAD
)
{
FD_SET
(
td
->
dummy_sock
,
write_fd_set
);
*
max_fdp
=
td
->
dummy_sock
;
}
#else
/* if not USE_THREADING_GETHOSTBYNAME */
(
void
)
conn
;
(
void
)
read_fd_set
;
(
void
)
write_fd_set
;
(
void
)
max_fdp
;
#endif
return
CURLE_OK
;
}
#endif
#endif
/* !USE_ARES */
#if defined(ENABLE_IPV6) && !defined(USE_ARES)
...
...
@@ -1332,7 +1341,7 @@ static void trace_it (const char *fmt, ...)
return
;
va_start
(
args
,
fmt
);
vfprintf
(
stderr
,
fmt
,
args
);
fflush
(
stderr
);
/*
fflush (stderr);
*/
/* seems a bad idea in a multi-threaded app */
va_end
(
args
);
}
#endif
...
...
@@ -1373,8 +1382,14 @@ static void destroy_thread_data (struct Curl_async *async)
{
if
(
async
->
hostname
)
free
(
async
->
hostname
);
if
(
async
->
os_specific
)
if
(
async
->
os_specific
)
{
curl_socket_t
sock
=
((
const
struct
thread_data
*
)
async
->
os_specific
)
->
dummy_sock
;
if
(
sock
!=
CURL_SOCKET_BAD
)
sclose
(
sock
);
free
(
async
->
os_specific
);
}
async
->
hostname
=
NULL
;
async
->
os_specific
=
NULL
;
}
...
...
@@ -1407,6 +1422,7 @@ static bool init_gethostbyname_thread (struct connectdata *conn,
conn
->
async
.
dns
=
NULL
;
conn
->
async
.
os_specific
=
(
void
*
)
td
;
td
->
dummy_sock
=
CURL_SOCKET_BAD
;
td
->
thread_hnd
=
(
HANDLE
)
_beginthreadex
(
NULL
,
0
,
gethostbyname_thread
,
conn
,
0
,
&
td
->
thread_id
);
if
(
!
td
->
thread_hnd
)
{
...
...
@@ -1415,6 +1431,11 @@ static bool init_gethostbyname_thread (struct connectdata *conn,
destroy_thread_data
(
&
conn
->
async
);
return
(
0
);
}
/* This socket is only to keep Curl_multi_ares_fdset() and select() happy;
* should never become signalled for read/write since it's unbound but
* Windows needs atleast 1 socket in select().
*/
td
->
dummy_sock
=
socket
(
AF_INET
,
SOCK_DGRAM
,
0
);
return
(
1
);
}
...
...
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