#include <iostream>
#include <list>
-#include "zypp/base/Logger.h"
-#include "zypp/ExternalProgram.h"
-#include "zypp/base/String.h"
-#include "zypp/base/Gettext.h"
-#include "zypp/base/Sysconfig.h"
-#include "zypp/base/Gettext.h"
-
-#include "zypp/media/MediaCurl.h"
-#include "zypp/media/ProxyInfo.h"
-#include "zypp/media/MediaUserAuth.h"
-#include "zypp/media/CredentialManager.h"
-#include "zypp/media/CurlConfig.h"
-#include "zypp/media/CurlHelper.h"
-#include "zypp/Target.h"
-#include "zypp/ZYppFactory.h"
-#include "zypp/ZConfig.h"
+#include <zypp/base/Logger.h>
+#include <zypp/ExternalProgram.h>
+#include <zypp/base/String.h>
+#include <zypp/base/Gettext.h>
+#include <zypp/base/Sysconfig.h>
+#include <zypp/base/Gettext.h>
+
+#include <zypp/media/MediaCurl.h>
+#include <zypp/media/ProxyInfo.h>
+#include <zypp/media/MediaUserAuth.h>
+#include <zypp/media/CredentialManager.h>
+#include <zypp/media/CurlConfig.h>
+#include <zypp/media/CurlHelper.h>
+#include <zypp/Target.h>
+#include <zypp/ZYppFactory.h>
+#include <zypp/ZConfig.h>
#include <cstdlib>
#include <sys/types.h>
#include <dirent.h>
#include <unistd.h>
-using namespace std;
+using std::endl;
+
using namespace internal;
using namespace zypp::base;
if ( _settings.userPassword().size() )
{
SET_OPTION(CURLOPT_USERPWD, _settings.userPassword().c_str());
- string use_auth = _settings.authType();
+ std::string use_auth = _settings.authType();
if (use_auth.empty())
use_auth = "digest,basic"; // our default
long auth = CurlAuthData::auth_type_str2long(use_auth);
* If not provided, $HOME/.curlrc is evaluated
*---------------------------------------------------------------*/
- string proxyuserpwd = _settings.proxyUserPassword();
+ std::string proxyuserpwd = _settings.proxyUserPassword();
if ( proxyuserpwd.empty() )
{
&httpReturnCode );
if ( infoRet == CURLE_OK )
{
- string msg = "HTTP response: " + str::numstring( httpReturnCode );
+ std::string msg = "HTTP response: " + str::numstring( httpReturnCode );
switch ( httpReturnCode )
{
case 401:
{
- string auth_hint = getAuthHint();
+ std::string auth_hint = getAuthHint();
DBG << msg << " Login failed (URL: " << url.asString() << ")" << std::endl;
DBG << "MediaUnauthorizedException auth hint: '" << auth_hint << "'" << std::endl;
ZYPP_THROW(MediaTimeoutException(url));
case 403:
{
- string msg403;
- if ( url.getHost().find(".suse.com") != string::npos )
+ std::string msg403;
+ if ( url.getHost().find(".suse.com") != std::string::npos )
msg403 = _("Visit the SUSE Customer Center to check whether your registration is valid and has not expired.");
- else if (url.asString().find("novell.com") != string::npos)
+ else if (url.asString().find("novell.com") != std::string::npos)
msg403 = _("Visit the Novell Customer Center to check whether your registration is valid and has not expired.");
ZYPP_THROW(MediaForbiddenException(url, msg403));
}
}
else
{
- string msg = "Unable to retrieve HTTP response:";
+ std::string msg = "Unable to retrieve HTTP response:";
DBG << msg << " (URL: " << url.asString() << ")" << std::endl;
ZYPP_THROW(MediaCurlException(url, msg, _curlError));
}
// contains an absolute path.
//
_lastRedirect.clear();
- string urlBuffer( curlUrl.asString());
+ std::string urlBuffer( curlUrl.asString());
CURLcode ret = curl_easy_setopt( _curl, CURLOPT_URL,
urlBuffer.c_str() );
if ( ret != 0 ) {
// contains an absolute path.
//
_lastRedirect.clear();
- string urlBuffer( curlUrl.asString());
+ std::string urlBuffer( curlUrl.asString());
CURLcode ret = curl_easy_setopt( _curl, CURLOPT_URL,
urlBuffer.c_str() );
if ( ret != 0 ) {
///////////////////////////////////////////////////////////////////
-string MediaCurl::getAuthHint() const
+std::string MediaCurl::getAuthHint() const
{
long auth_info = CURLAUTH_NONE;
///////////////////////////////////////////////////////////////////
-bool MediaCurl::authenticate(const string & availAuthTypes, bool firstTry) const
+bool MediaCurl::authenticate(const std::string & availAuthTypes, bool firstTry) const
{
//! \todo need a way to pass different CredManagerOptions here
CredentialManager cm(CredManagerOptions(ZConfig::instance().repoManagerRoot()));
// indicate we have no good credentials from CM
cmcred.reset();
- string prompt_msg = str::Format(_("Authentication required for '%s'")) % _url.asString();
+ std::string prompt_msg = str::Format(_("Authentication required for '%s'")) % _url.asString();
// set available authentication types from the exception
// might be needed in prompt