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
1f17fb5f
Commit
1f17fb5f
authored
24 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
Now persistant connection download works thanks to the Content-Length taken
into account
parent
584dbffe
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/transfer.c
+17
-6
17 additions, 6 deletions
lib/transfer.c
with
17 additions
and
6 deletions
lib/transfer.c
+
17
−
6
View file @
1f17fb5f
...
...
@@ -127,6 +127,7 @@ _Transfer(struct connectdata *c_conn)
int
offset
=
0
;
/* possible resume offset read from the
Content-Range: header */
int
code
=
0
;
/* error code from the 'HTTP/1.? XXX' line */
int
httpversion
=
-
1
;
/* the last digit in the HTTP/1.1 string */
/* for the low speed checks: */
CURLcode
urg
;
...
...
@@ -319,9 +320,9 @@ _Transfer(struct connectdata *c_conn)
p
++
;
/* pass the \r byte */
if
(
'\n'
==
*
p
)
p
++
;
/* pass the \n byte */
#if 0 /* headers are not included in the size */
Curl_pgrsSetDownloadSize(data, conn->size);
#endif
header
=
FALSE
;
/* no more header to parse! */
/* now, only output this if the header AND body are requested:
...
...
@@ -342,7 +343,7 @@ _Transfer(struct connectdata *c_conn)
if
(
!
headerline
++
)
{
/* This is the first header, it MUST be the error code line
or else we consiser this to be the body right away! */
if
(
sscanf
(
p
,
" HTTP/1.%
*c
%3d"
,
&
code
))
{
if
(
2
==
sscanf
(
p
,
" HTTP/1.%
d
%3d"
,
&
httpversion
,
&
code
))
{
/* 404 -> URL not found! */
if
(
(
((
data
->
bits
.
http_follow_location
)
&&
(
code
>=
400
))
...
...
@@ -499,13 +500,23 @@ _Transfer(struct connectdata *c_conn)
}
/* switch */
}
/* two valid time strings */
}
/* we have a time condition */
if
(
!
conn
->
bits
.
close
&&
(
httpversion
==
1
))
{
/* If this is not the last request before a close, we must
set the maximum download size to the size of the expected
document or else, we won't know when to stop reading! */
if
(
-
1
!=
conn
->
size
)
conn
->
maxdownload
=
conn
->
size
;
/* What to do if the size is *not* known? */
}
}
/* this is HTTP */
}
/* this is the first time we write a body part */
bodywrites
++
;
if
(
data
->
maxdownload
&&
(
bytecount
+
nread
>
data
->
maxdownload
))
{
nread
=
data
->
maxdownload
-
bytecount
;
if
(
conn
->
maxdownload
&&
(
bytecount
+
nread
>
=
conn
->
maxdownload
))
{
nread
=
conn
->
maxdownload
-
bytecount
;
if
((
signed
int
)
nread
<
0
)
/* this should be unusual */
nread
=
0
;
keepon
&=
~
KEEP_READ
;
/* we're done reading */
...
...
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