summaryrefslogtreecommitdiff
path: root/ucb/source/ucp/ftp/ftpurl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'ucb/source/ucp/ftp/ftpurl.cxx')
-rw-r--r--ucb/source/ucp/ftp/ftpurl.cxx23
1 files changed, 14 insertions, 9 deletions
diff --git a/ucb/source/ucp/ftp/ftpurl.cxx b/ucb/source/ucp/ftp/ftpurl.cxx
index 420b3f993f4f..52615e79f90e 100644
--- a/ucb/source/ucp/ftp/ftpurl.cxx
+++ b/ucb/source/ucp/ftp/ftpurl.cxx
@@ -163,19 +163,18 @@ void FTPURL::parse(const rtl::OUString& url)
rtl::OString aIdent(url.getStr(),
url.getLength(),
RTL_TEXTENCODING_UTF8);
- char *buffer = new char[1+aIdent.getLength()];
-
- const char* p2 = aIdent.getStr();
rtl::OString lower = aIdent.toAsciiLowerCase();
if(lower.getLength() < 6 ||
strncmp("ftp://",lower.getStr(),6))
throw malformed_exception();
+ char *buffer = new char[1+aIdent.getLength()];
+ const char* p2 = aIdent.getStr();
p2 += 6;
char ch;
- char *p1 = buffer; // determine "username:password@host:port"
+ char *p1 = buffer; // determine "username:password@host:port"
while((ch = *p2++) != '/' && ch)
*p1++ = ch;
*p1 = 0;
@@ -393,7 +392,7 @@ namespace ftp {
#define SET_DATA_CONTAINER \
- curl_easy_setopt(curl,CURLOPT_NOBODY,false); \
+ curl_easy_setopt(curl,CURLOPT_NOBODY,false); \
MemoryContainer data; \
curl_easy_setopt(curl,CURLOPT_WRITEFUNCTION,memory_write); \
curl_easy_setopt(curl,CURLOPT_WRITEDATA,&data)
@@ -590,6 +589,12 @@ rtl::OUString FTPURL::net_title() const
// the client should retry after getting the correct
// username + password
throw curl_exception(err);
+#if LIBCURL_VERSION_NUM>=0x070d01 /* 7.13.1 */
+ else if(err == CURLE_LOGIN_DENIED)
+ // the client should retry after getting the correct
+ // username + password
+ throw curl_exception(err);
+#endif
else if(try_more && err == CURLE_FTP_ACCESS_DENIED) {
// We were either denied access when trying to login to
// an FTP server or when trying to change working directory
@@ -665,8 +670,8 @@ void FTPURL::insert(bool replaceExisting,void* stream) const
throw(curl_exception)
{
if(!replaceExisting) {
-// FTPDirentry aDirentry(direntry());
-// if(aDirentry.m_nMode == INETCOREFTP_FILEMODE_UNKNOWN)
+// FTPDirentry aDirentry(direntry());
+// if(aDirentry.m_nMode == INETCOREFTP_FILEMODE_UNKNOWN)
// throw curl_exception(FILE_EXIST_DURING_INSERT);
throw curl_exception(FILE_MIGHT_EXIST_DURING_INSERT);
} // else
@@ -716,8 +721,8 @@ void FTPURL::mkdir(bool ReplaceExisting) const
FTPDirentry aDirentry(direntry());
if(!ReplaceExisting) {
-// if(aDirentry.m_nMode != INETCOREFTP_FILEMODE_UNKNOWN)
-// throw curl_exception(FOLDER_EXIST_DURING_INSERT);
+// if(aDirentry.m_nMode != INETCOREFTP_FILEMODE_UNKNOWN)
+// throw curl_exception(FOLDER_EXIST_DURING_INSERT);
throw curl_exception(FOLDER_MIGHT_EXIST_DURING_INSERT);
} else if(aDirentry.m_nMode != INETCOREFTP_FILEMODE_UNKNOWN)
slist = curl_slist_append(slist,aDel.getStr());