Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Unmaintained
KDE Libraries
Commits
d6453435
Commit
d6453435
authored
Mar 01, 2014
by
Dawit Alemayehu
Browse files
Whenever possible, use relative paths for SIZE requests, e.g. SIZE foo/bar.txt
BUG: 326292 FIXED-IN: 4.12.4 REVIEW: 116524
parent
61bbbda6
Changes
1
Hide whitespace changes
Inline
Side-by-side
kioslave/ftp/ftp.cpp
View file @
d6453435
...
...
@@ -2265,11 +2265,24 @@ bool Ftp::ftpSize( const QString & path, char mode )
if
(
!
ftpDataMode
(
mode
)
)
return
false
;
// Some servers do not allow absolute path for SIZE; so we use
// relative paths whenever possible. #326292
QString
currentPath
(
m_currentPath
);
if
(
!
currentPath
.
endsWith
(
QLatin1Char
(
'/'
)))
{
currentPath
+=
QLatin1Char
(
'/'
);
}
QByteArray
buf
;
buf
=
"SIZE "
;
buf
+=
remoteEncoding
()
->
encode
(
path
);
if
(
!
ftpSendCmd
(
buf
)
||
(
m_iRespType
!=
2
)
)
return
false
;
if
(
path
.
startsWith
(
currentPath
))
{
buf
+=
remoteEncoding
()
->
encode
(
path
.
mid
(
currentPath
.
length
()));
}
else
{
buf
+=
remoteEncoding
()
->
encode
(
path
);
}
if
(
!
ftpSendCmd
(
buf
)
||
m_iRespType
!=
2
)
{
return
false
;
}
// skip leading "213 " (response code)
QByteArray
psz
(
ftpResponse
(
4
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment