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
5e7cd528
Commit
5e7cd528
authored
24 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
made -I (size info only) work for ftp again
parent
60eab89f
Loading
Loading
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/ftp.c
+26
-25
26 additions, 25 deletions
lib/ftp.c
lib/highlevel.c
+3
-1
3 additions, 1 deletion
lib/highlevel.c
with
29 additions
and
26 deletions
lib/ftp.c
+
26
−
25
View file @
5e7cd528
...
...
@@ -471,7 +471,7 @@ CURLcode ftp_done(struct connectdata *conn)
failf
(
data
,
"Received only partial file"
);
return
CURLE_PARTIAL_FILE
;
}
else
if
(
0
==
*
ftp
->
bytecountp
)
{
else
if
(
!
data
->
bits
.
no_body
&&
(
0
==
*
ftp
->
bytecountp
)
)
{
failf
(
data
,
"No data was received!"
);
return
CURLE_FTP_COULDNT_RETR_FILE
;
}
...
...
@@ -479,17 +479,19 @@ CURLcode ftp_done(struct connectdata *conn)
/* shut down the socket to inform the server we're done */
sclose
(
data
->
secondarysocket
);
data
->
secondarysocket
=
-
1
;
/* now let's see what the server says about the transfer we
just performed: */
nread
=
GetLastResponse
(
data
->
firstsocket
,
buf
,
conn
);
if
(
nread
<
0
)
return
CURLE_OPERATION_TIMEOUTED
;
/* 226 Transfer complete, 250 Requested file action okay, completed. */
if
(
!
strncmp
(
buf
,
"226"
,
3
)
&&
!
strncmp
(
buf
,
"250"
,
3
))
{
failf
(
data
,
"%s"
,
buf
+
4
);
return
CURLE_FTP_WRITE_ERROR
;
if
(
!
data
->
bits
.
no_body
)
{
/* now let's see what the server says about the transfer we
just performed: */
nread
=
GetLastResponse
(
data
->
firstsocket
,
buf
,
conn
);
if
(
nread
<
0
)
return
CURLE_OPERATION_TIMEOUTED
;
/* 226 Transfer complete, 250 Requested file action okay, completed. */
if
(
!
strncmp
(
buf
,
"226"
,
3
)
&&
!
strncmp
(
buf
,
"250"
,
3
))
{
failf
(
data
,
"%s"
,
buf
+
4
);
return
CURLE_FTP_WRITE_ERROR
;
}
}
/* Send any post-transfer QUOTE strings? */
...
...
@@ -572,6 +574,19 @@ CURLcode _ftp(struct connectdata *conn)
}
}
/* change directory first! */
if
(
ftp
->
dir
&&
ftp
->
dir
[
0
])
{
sendf
(
data
->
firstsocket
,
data
,
"CWD %s
\r\n
"
,
ftp
->
dir
);
nread
=
GetLastResponse
(
data
->
firstsocket
,
buf
,
conn
);
if
(
nread
<
0
)
return
CURLE_OPERATION_TIMEOUTED
;
if
(
strncmp
(
buf
,
"250"
,
3
))
{
failf
(
data
,
"Couldn't change to directory %s"
,
ftp
->
dir
);
return
CURLE_FTP_ACCESS_DENIED
;
}
}
/* If we have selected NOBODY, it means that we only want file information.
Which in FTP can't be much more than the file size! */
if
(
data
->
bits
.
no_body
)
{
...
...
@@ -851,20 +866,6 @@ CURLcode _ftp(struct connectdata *conn)
/* we have the (new) data connection ready */
infof
(
data
,
"Connected!
\n
"
);
/* change directory first */
if
(
ftp
->
dir
&&
ftp
->
dir
[
0
])
{
sendf
(
data
->
firstsocket
,
data
,
"CWD %s
\r\n
"
,
ftp
->
dir
);
nread
=
GetLastResponse
(
data
->
firstsocket
,
buf
,
conn
);
if
(
nread
<
0
)
return
CURLE_OPERATION_TIMEOUTED
;
if
(
strncmp
(
buf
,
"250"
,
3
))
{
failf
(
data
,
"Couldn't change to directory %s"
,
ftp
->
dir
);
return
CURLE_FTP_ACCESS_DENIED
;
}
}
if
(
data
->
bits
.
upload
)
{
/* Set type to binary (unless specified ASCII) */
...
...
This diff is collapsed.
Click to expand it.
lib/highlevel.c
+
3
−
1
View file @
5e7cd528
...
...
@@ -172,7 +172,9 @@ _Transfer(struct connectdata *c_conn)
if
(
conn
->
size
>
0
)
pgrsSetDownloadSize
(
data
,
conn
->
size
);
}
{
/* we want header and/or body, if neither then don't do this! */
if
(
conn
->
getheader
||
!
data
->
bits
.
no_body
)
{
fd_set
readfd
;
fd_set
writefd
;
fd_set
rkeepfd
;
...
...
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