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
135cc036
Commit
135cc036
authored
24 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
made the speedcheck actually work again
parent
f6163b37
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
lib/highlevel.c
+1
-0
1 addition, 0 deletions
lib/highlevel.c
lib/speedcheck.c
+10
-7
10 additions, 7 deletions
lib/speedcheck.c
lib/speedcheck.h
+1
-0
1 addition, 0 deletions
lib/speedcheck.h
lib/urldata.h
+2
-0
2 additions, 0 deletions
lib/urldata.h
with
14 additions
and
7 deletions
lib/highlevel.c
+
1
−
0
View file @
135cc036
...
...
@@ -174,6 +174,7 @@ _Transfer(struct connectdata *c_conn)
#define KEEP_WRITE 2
pgrsTime
(
data
,
TIMER_PRETRANSFER
);
speedinit
(
data
);
if
(
!
conn
->
getheader
)
{
header
=
FALSE
;
...
...
This diff is collapsed.
Click to expand it.
lib/speedcheck.c
+
10
−
7
View file @
135cc036
...
...
@@ -50,21 +50,24 @@
#include
"sendf.h"
#include
"speedcheck.h"
void
speedinit
(
struct
UrlData
*
data
)
{
memset
(
&
data
->
keeps_speed
,
0
,
sizeof
(
struct
timeval
));
}
CURLcode
speedcheck
(
struct
UrlData
*
data
,
struct
timeval
now
)
{
static
struct
timeval
keeps_speed
;
if
((
data
->
current_speed
>=
0
)
&&
if
((
data
->
progress
.
current_speed
>=
0
)
&&
data
->
low_speed_time
&&
(
tvlong
(
keeps_speed
)
!=
0
)
&&
(
data
->
current_speed
<
data
->
low_speed_limit
))
{
(
tvlong
(
data
->
keeps_speed
)
!=
0
)
&&
(
data
->
progress
.
current_speed
<
data
->
low_speed_limit
))
{
/* We are now below the "low speed limit". If we are below it
for "low speed time" seconds we consider that enough reason
to abort the download. */
if
(
tvdiff
(
now
,
keeps_speed
)
>
data
->
low_speed_time
)
{
if
(
tvdiff
(
now
,
data
->
keeps_speed
)
>
data
->
low_speed_time
)
{
/* we have been this slow for long enough, now die */
failf
(
data
,
"Operation too slow. "
...
...
@@ -76,7 +79,7 @@ CURLcode speedcheck(struct UrlData *data,
}
else
{
/* we keep up the required speed all right */
keeps_speed
=
now
;
data
->
keeps_speed
=
now
;
}
return
CURLE_OK
;
}
...
...
This diff is collapsed.
Click to expand it.
lib/speedcheck.h
+
1
−
0
View file @
135cc036
...
...
@@ -44,6 +44,7 @@
#include
"timeval.h"
void
speedinit
(
struct
UrlData
*
data
);
CURLcode
speedcheck
(
struct
UrlData
*
data
,
struct
timeval
now
);
...
...
This diff is collapsed.
Click to expand it.
lib/urldata.h
+
2
−
0
View file @
135cc036
...
...
@@ -503,6 +503,8 @@ struct UrlData {
#ifdef KRB4
FILE
*
cmdchannel
;
#endif
struct
timeval
keeps_speed
;
/* this should be request-specific */
};
#define LIBCURL_NAME "libcurl"
...
...
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