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
1eebb900
Commit
1eebb900
authored
16 years ago
by
Yang Tse
Browse files
Options
Downloads
Patches
Plain Diff
improve easy interface resolving timeout handling in c-ares enabled builds
parent
ab716540
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/hostares.c
+12
-12
12 additions, 12 deletions
lib/hostares.c
with
12 additions
and
12 deletions
lib/hostares.c
+
12
−
12
View file @
1eebb900
...
...
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 200
7
, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 200
8
, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
...
...
@@ -143,30 +143,27 @@ static int ares_waitperform(struct connectdata *conn, int timeout_ms)
int
bitmask
;
int
socks
[
ARES_GETSOCK_MAXNUM
];
struct
pollfd
pfd
[
ARES_GETSOCK_MAXNUM
];
int
m
;
int
i
;
int
num
;
int
num
=
0
;
bitmask
=
ares_getsock
(
data
->
state
.
areschannel
,
socks
,
ARES_GETSOCK_MAXNUM
);
for
(
i
=
0
;
i
<
ARES_GETSOCK_MAXNUM
;
i
++
)
{
pfd
[
i
].
events
=
0
;
m
=
0
;
pfd
[
i
].
revents
=
0
;
if
(
ARES_GETSOCK_READABLE
(
bitmask
,
i
))
{
pfd
[
i
].
fd
=
socks
[
i
];
pfd
[
i
].
events
|=
POLLRDNORM
|
POLLIN
;
m
=
1
;
}
if
(
ARES_GETSOCK_WRITABLE
(
bitmask
,
i
))
{
pfd
[
i
].
fd
=
socks
[
i
];
pfd
[
i
].
events
|=
POLLWRNORM
|
POLLOUT
;
m
=
1
;
}
pfd
[
i
].
revents
=
0
;
if
(
!
m
)
if
(
pfd
[
i
].
events
!=
0
)
num
++
;
else
break
;
}
num
=
i
;
if
(
num
)
nfds
=
Curl_poll
(
pfd
,
num
,
timeout_ms
);
...
...
@@ -233,6 +230,7 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn,
CURLcode
rc
=
CURLE_OK
;
struct
SessionHandle
*
data
=
conn
->
data
;
long
timeout
;
struct
timeval
now
=
Curl_tvnow
();
/* now, see if there's a connect timeout or a regular timeout to
use instead of the default one */
...
...
@@ -246,11 +244,13 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn,
/* Wait for the name resolve query to complete. */
while
(
1
)
{
struct
timeval
*
tvp
,
tv
,
store
;
struct
timeval
now
=
Curl_tvnow
();
long
timediff
;
int
itimeout
;
itimeout
=
(
timeout
>
(
long
)
INT_MAX
)
?
INT_MAX
:
(
int
)
timeout
;
store
.
tv_sec
=
(
int
)
timeout
/
1000
;
store
.
tv_usec
=
(
timeout
%
1000
)
*
1000
;
store
.
tv_sec
=
i
timeout
/
1000
;
store
.
tv_usec
=
(
i
timeout
%
1000
)
*
1000
;
tvp
=
ares_timeout
(
data
->
state
.
areschannel
,
&
store
,
&
tv
);
...
...
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