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
3c63e1d8
Commit
3c63e1d8
authored
22 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
Added 'dont_check' to be set during an FTP operation if the final status
message is supposed to be ignored.
parent
cae555c9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/ftp.c
+20
-14
20 additions, 14 deletions
lib/ftp.c
lib/urldata.h
+3
-1
3 additions, 1 deletion
lib/urldata.h
with
23 additions
and
15 deletions
lib/ftp.c
+
20
−
14
View file @
3c63e1d8
...
...
@@ -637,9 +637,9 @@ CURLcode Curl_ftp_done(struct connectdata *conn)
failf
(
data
,
"Received only partial file: %d bytes"
,
*
ftp
->
bytecountp
);
return
CURLE_PARTIAL_FILE
;
}
else
if
(
!
conn
->
bits
.
resume_done
&&
!
data
->
set
.
no_body
&&
(
!*
ftp
->
bytecountp
&&
(
conn
->
size
>
0
))
)
{
else
if
(
!
ftp
->
dont_check
&&
!
*
ftp
->
bytecountp
&&
(
conn
->
size
>
0
))
{
/* We consider this an error, but there's no true FTP error received
why we need to continue to "read out" the server response too.
We don't want to leave a "waiting" server reply if we'll get told
...
...
@@ -656,21 +656,24 @@ CURLcode Curl_ftp_done(struct connectdata *conn)
sclose
(
conn
->
secondarysocket
);
conn
->
secondarysocket
=
-
1
;
if
(
!
data
->
set
.
no_body
)
{
if
(
!
data
->
set
.
no_body
&&
!
ftp
->
dont_check
)
{
/* now let's see what the server says about the transfer we just
performed: */
nread
=
Curl_GetFTPResponse
(
buf
,
conn
,
&
ftpcode
);
if
(
nread
<
0
)
return
CURLE_OPERATION_TIMEOUTED
;
if
(
!
conn
->
bits
.
resume_done
)
{
/* 226 Transfer complete, 250 Requested file action okay, completed. */
if
((
ftpcode
!=
226
)
&&
(
ftpcode
!=
250
))
{
failf
(
data
,
"server did not report OK, got %d"
,
ftpcode
);
return
CURLE_FTP_WRITE_ERROR
;
}
/* 226 Transfer complete, 250 Requested file action okay, completed. */
if
((
ftpcode
!=
226
)
&&
(
ftpcode
!=
250
))
{
failf
(
data
,
"server did not report OK, got %d"
,
ftpcode
);
return
CURLE_FTP_WRITE_ERROR
;
}
}
if
(
ftp
->
dont_check
)
{
/* if we don't check, we can't re-use this connection as it leaves the
control connection in a weird status */
conn
->
bits
.
close
=
TRUE
;
}
conn
->
bits
.
resume_done
=
FALSE
;
/* clean this for next connection */
...
...
@@ -1601,7 +1604,7 @@ CURLcode ftp_perform(struct connectdata *conn)
if
(
data
->
set
.
no_body
)
/* don't transfer the data */
;
ftp
->
dont_check
=
TRUE
;
/* Get us a second connection up and connected */
else
if
(
data
->
set
.
ftp_use_port
)
{
/* We have chosen to use the PORT command */
...
...
@@ -1697,10 +1700,11 @@ CURLcode ftp_perform(struct connectdata *conn)
/* no data to transfer */
result
=
Curl_Transfer
(
conn
,
-
1
,
-
1
,
FALSE
,
NULL
,
-
1
,
NULL
);
/* Set resume done so that we won't get any error
in
* Curl_ftp_done() because we didn't transfer the amount of
bytes
* that the local file file obviously is */
/* Set resume done
and dont_check
so that we won't get any error
*
in
Curl_ftp_done() because we didn't transfer the amount of
*
bytes
that the local file file obviously is */
conn
->
bits
.
resume_done
=
TRUE
;
ftp
->
dont_check
=
TRUE
;
return
CURLE_OK
;
}
...
...
@@ -1790,6 +1794,7 @@ CURLcode ftp_perform(struct connectdata *conn)
infof
(
data
,
"range-download from %d to %d, totally %d bytes
\n
"
,
from
,
to
,
totalsize
);
conn
->
bits
.
resume_done
=
TRUE
;
/* to prevent some error due to this */
ftp
->
dont_check
=
TRUE
;
/* dont check for successful transfer */
}
if
((
data
->
set
.
ftp_list_only
)
||
!
ftp
->
file
)
{
...
...
@@ -1886,6 +1891,7 @@ CURLcode ftp_perform(struct connectdata *conn)
* because we didn't transfer the amount of bytes that the remote
* file obviously is */
conn
->
bits
.
resume_done
=
TRUE
;
ftp
->
dont_check
=
TRUE
;
return
CURLE_OK
;
}
...
...
This diff is collapsed.
Click to expand it.
lib/urldata.h
+
3
−
1
View file @
3c63e1d8
...
...
@@ -179,7 +179,9 @@ struct FTP {
char
*
entrypath
;
/* the PWD reply when we logged on */
char
*
cache
;
/* data cache between getresponse()-calls */
size_t
cache_size
;
/* size of cache in bytes */
size_t
cache_size
;
/* size of cache in bytes */
bool
dont_check
;
/* set to TRUE to prevent the final (post-transfer)
file size and 226/250 status check */
};
/****************************************************************************
...
...
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