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
f1b8566e
Commit
f1b8566e
authored
24 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
new upload-buffer size design that starts with a smallish buffer and increases
its size in case of need
parent
d3f9b2a4
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/highlevel.c
+14
-1
14 additions, 1 deletion
lib/highlevel.c
with
14 additions
and
1 deletion
lib/highlevel.c
+
14
−
1
View file @
f1b8566e
...
...
@@ -112,6 +112,10 @@
#define _MPRINTF_REPLACE
/* use our functions only */
#include
<curl/mprintf.h>
#ifndef min
#define min(a, b) ((a) < (b) ? (a) : (b))
#endif
CURLcode
_Transfer
(
struct
connectdata
*
c_conn
)
{
...
...
@@ -522,7 +526,7 @@ _Transfer(struct connectdata *c_conn)
if
(
data
->
crlf
)
buf
=
data
->
buffer
;
/* put it back on the buffer */
nread
=
data
->
fread
(
buf
,
1
,
BUFSIZE
,
data
->
in
);
nread
=
data
->
fread
(
buf
,
1
,
conn
->
upload_bufsize
,
data
->
in
);
/* the signed int typecase of nread of for systems that has
unsigned size_t */
...
...
@@ -570,6 +574,15 @@ _Transfer(struct connectdata *c_conn)
if
(
urg
)
return
urg
;
if
(
data
->
progress
.
ulspeed
>
conn
->
upload_bufsize
)
{
/* If we're transfering more data per second than fits in our buffer,
we increase the buffer size to adjust to the current
speed. However, we must not set it larger than BUFSIZE. We don't
adjust it downwards again since we don't see any point in that!
*/
conn
->
upload_bufsize
=
(
long
)
min
(
data
->
progress
.
ulspeed
,
BUFSIZE
);
}
if
(
data
->
timeout
&&
(
tvdiff
(
now
,
start
)
>
data
->
timeout
))
{
failf
(
data
,
"Operation timed out with %d out of %d bytes received"
,
bytecount
,
conn
->
size
);
...
...
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