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
88944eb1
Commit
88944eb1
authored
15 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
- Make sure the progress callback is called repeatedly even during very slow
name resolves when c-ares is used for resolving.
parent
bd8096b4
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
CHANGES
+4
-0
4 additions, 0 deletions
CHANGES
RELEASE-NOTES
+1
-0
1 addition, 0 deletions
RELEASE-NOTES
lib/hostares.c
+23
-8
23 additions, 8 deletions
lib/hostares.c
with
28 additions
and
8 deletions
CHANGES
+
4
−
0
View file @
88944eb1
...
...
@@ -6,6 +6,10 @@
Changelog
Daniel Stenberg (7 Jan 2010)
- Make sure the progress callback is called repeatedly even during very slow
name resolves when c-ares is used for resolving.
Claes Jakobsson (6 Jan 2010)
- Julien Chaffraix fixed so that the fragment part in an URL is not sent
to the server anymore.
...
...
This diff is collapsed.
Click to expand it.
RELEASE-NOTES
+
1
−
0
View file @
88944eb1
...
...
@@ -41,6 +41,7 @@ This release includes the following bugfixes:
o libcurl-OpenSSL engine cleanup
o header include fix for FreeBSD versions before v8
o fragment part of URLs are no longer sent to the server
o progress callback called repeatedly with c-ares for resolving
This release includes the following known bugs:
...
...
This diff is collapsed.
Click to expand it.
lib/hostares.c
+
23
−
8
View file @
88944eb1
...
...
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 200
9
, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 20
1
0, 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
...
...
@@ -72,6 +72,7 @@
#include
"inet_pton.h"
#include
"connect.h"
#include
"select.h"
#include
"progress.h"
#define _MPRINTF_REPLACE
/* use our functions only */
#include
<curl/mprintf.h>
...
...
@@ -119,7 +120,7 @@ int Curl_resolv_getsock(struct connectdata *conn,
}
/*
*
ares_
waitperform()
* waitperform()
*
* 1) Ask ares what sockets it currently plays with, then
* 2) wait for the timeout period to check for action on ares' sockets.
...
...
@@ -128,7 +129,7 @@ int Curl_resolv_getsock(struct connectdata *conn,
* return number of sockets it worked on
*/
static
int
ares_
waitperform
(
struct
connectdata
*
conn
,
int
timeout_ms
)
static
int
waitperform
(
struct
connectdata
*
conn
,
int
timeout_ms
)
{
struct
SessionHandle
*
data
=
conn
->
data
;
int
nfds
;
...
...
@@ -192,7 +193,7 @@ CURLcode Curl_is_resolved(struct connectdata *conn,
*
dns
=
NULL
;
ares_
waitperform
(
conn
,
0
);
waitperform
(
conn
,
0
);
if
(
conn
->
async
.
done
)
{
/* we're done, kill the ares handle */
...
...
@@ -238,6 +239,7 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn,
struct
timeval
*
tvp
,
tv
,
store
;
long
timediff
;
int
itimeout
;
int
timeout_ms
;
itimeout
=
(
timeout
>
(
long
)
INT_MAX
)
?
INT_MAX
:
(
int
)
timeout
;
...
...
@@ -246,14 +248,27 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn,
tvp
=
ares_timeout
(
data
->
state
.
areschannel
,
&
store
,
&
tv
);
/* use the timeout period ares returned to us above */
ares_waitperform
(
conn
,
(
int
)(
tvp
->
tv_sec
*
1000
+
tvp
->
tv_usec
/
1000
));
/* use the timeout period ares returned to us above if less than one
second is left, otherwise just use 1000ms to make sure the progress
callback gets called frequent enough */
if
(
!
tvp
->
tv_sec
)
timeout_ms
=
tvp
->
tv_usec
/
1000
;
else
timeout_ms
=
1000
;
waitperform
(
conn
,
timeout_ms
);
if
(
conn
->
async
.
done
)
break
;
timediff
=
Curl_tvdiff
(
Curl_tvnow
(),
now
);
/* spent time */
timeout
-=
timediff
?
timediff
:
1
;
/* always deduct at least 1 */
if
(
Curl_pgrsUpdate
(
conn
))
{
rc
=
CURLE_ABORTED_BY_CALLBACK
;
timeout
=
-
1
;
/* trigger the cancel below */
}
else
{
timediff
=
Curl_tvdiff
(
Curl_tvnow
(),
now
);
/* spent time */
timeout
-=
timediff
?
timediff
:
1
;
/* always deduct at least 1 */
}
if
(
timeout
<
0
)
{
/* our timeout, so we cancel the ares operation */
ares_cancel
(
data
->
state
.
areschannel
);
...
...
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