Changeset View
Changeset View
Standalone View
Standalone View
src/ioslaves/http/http.cpp
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | Copyright (C) 2000-2003 Waldo Bastian <bastian@kde.org> | 2 | Copyright (C) 2000-2003 Waldo Bastian <bastian@kde.org> | ||
3 | Copyright (C) 2000-2002 George Staikos <staikos@kde.org> | 3 | Copyright (C) 2000-2002 George Staikos <staikos@kde.org> | ||
4 | Copyright (C) 2000-2002 Dawit Alemayehu <adawit@kde.org> | 4 | Copyright (C) 2000-2002 Dawit Alemayehu <adawit@kde.org> | ||
5 | Copyright (C) 2001,2002 Hamish Rodda <rodda@kde.org> | 5 | Copyright (C) 2001,2002 Hamish Rodda <rodda@kde.org> | ||
6 | Copyright (C) 2007 Nick Shaforostoff <shafff@ukr.net> | 6 | Copyright (C) 2007 Nick Shaforostoff <shafff@ukr.net> | ||
7 | Copyright (C) 2007 Daniel Nicoletti <mirttex@users.sourceforge.net> | 7 | Copyright (C) 2007-2018 Daniel Nicoletti <dantti12@gmail.com> | ||
8 | Copyright (C) 2008,2009 Andreas Hartmetz <ahartmetz@gmail.com> | 8 | Copyright (C) 2008,2009 Andreas Hartmetz <ahartmetz@gmail.com> | ||
9 | 9 | | |||
10 | This library is free software; you can redistribute it and/or | 10 | This library is free software; you can redistribute it and/or | ||
11 | modify it under the terms of the GNU Library General Public | 11 | modify it under the terms of the GNU Library General Public | ||
12 | License (LGPL) as published by the Free Software Foundation; | 12 | License (LGPL) as published by the Free Software Foundation; | ||
13 | either version 2 of the License, or (at your option) any later | 13 | either version 2 of the License, or (at your option) any later | ||
14 | version. | 14 | version. | ||
15 | 15 | | |||
▲ Show 20 Lines • Show All 1317 Lines • ▼ Show 20 Line(s) | 1329 | } else { | |||
1333 | 1333 | | |||
1334 | resetSessionSettings(); | 1334 | resetSessionSettings(); | ||
1335 | 1335 | | |||
1336 | // destination has to be "http(s)://..." | 1336 | // destination has to be "http(s)://..." | ||
1337 | QUrl newDest (dest); | 1337 | QUrl newDest (dest); | ||
1338 | changeProtocolToHttp(&newDest); | 1338 | changeProtocolToHttp(&newDest); | ||
1339 | 1339 | | |||
1340 | m_request.method = DAV_COPY; | 1340 | m_request.method = DAV_COPY; | ||
1341 | m_request.davData.desturl = newDest.url(); | 1341 | m_request.davData.desturl = newDest.toString(QUrl::FullyEncoded); | ||
1342 | m_request.davData.overwrite = (flags & KIO::Overwrite); | 1342 | m_request.davData.overwrite = (flags & KIO::Overwrite); | ||
1343 | m_request.url.setQuery(QString()); | 1343 | m_request.url.setQuery(QString()); | ||
1344 | m_request.cacheTag.policy = CC_Reload; | 1344 | m_request.cacheTag.policy = CC_Reload; | ||
1345 | 1345 | | |||
1346 | proceedUntilResponseHeader(); | 1346 | proceedUntilResponseHeader(); | ||
1347 | 1347 | | |||
1348 | // The server returns a HTTP/1.1 201 Created or 204 No Content on successful completion | 1348 | // The server returns a HTTP/1.1 201 Created or 204 No Content on successful completion | ||
1349 | if (m_request.responseCode == 201 || m_request.responseCode == 204) { | 1349 | if (m_request.responseCode == 201 || m_request.responseCode == 204) { | ||
Show All 13 Lines | 1358 | { | |||
1363 | } | 1363 | } | ||
1364 | resetSessionSettings(); | 1364 | resetSessionSettings(); | ||
1365 | 1365 | | |||
1366 | // destination has to be "http://..." | 1366 | // destination has to be "http://..." | ||
1367 | QUrl newDest(dest); | 1367 | QUrl newDest(dest); | ||
1368 | changeProtocolToHttp(&newDest); | 1368 | changeProtocolToHttp(&newDest); | ||
1369 | 1369 | | |||
1370 | m_request.method = DAV_MOVE; | 1370 | m_request.method = DAV_MOVE; | ||
1371 | m_request.davData.desturl = newDest.toString(); | 1371 | m_request.davData.desturl = newDest.toString(QUrl::FullyEncoded); | ||
1372 | m_request.davData.overwrite = (flags & KIO::Overwrite); | 1372 | m_request.davData.overwrite = (flags & KIO::Overwrite); | ||
1373 | m_request.url.setQuery(QString()); | 1373 | m_request.url.setQuery(QString()); | ||
1374 | m_request.cacheTag.policy = CC_Reload; | 1374 | m_request.cacheTag.policy = CC_Reload; | ||
1375 | 1375 | | |||
1376 | proceedUntilResponseHeader(); | 1376 | proceedUntilResponseHeader(); | ||
1377 | 1377 | | |||
1378 | // Work around strict Apache-2 WebDAV implementation which refuses to cooperate | 1378 | // Work around strict Apache-2 WebDAV implementation which refuses to cooperate | ||
1379 | // with webdav://host/directory, instead requiring webdav://host/directory/ | 1379 | // with webdav://host/directory, instead requiring webdav://host/directory/ | ||
▲ Show 20 Lines • Show All 4273 Lines • Show Last 20 Lines |