summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestSubmit.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2004-11-24 14:25:32 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2004-11-24 14:25:32 (GMT)
commita0c96218b08d6cb40c18ec3e8ee19def75d45272 (patch)
tree89d7d9647c140bc75bd5a634eba57d94a229bd76 /Source/CTest/cmCTestSubmit.cxx
parent67111942c0170891cc9d8c8ef92a641f01ccf9cb (diff)
downloadCMake-a0c96218b08d6cb40c18ec3e8ee19def75d45272.zip
CMake-a0c96218b08d6cb40c18ec3e8ee19def75d45272.tar.gz
CMake-a0c96218b08d6cb40c18ec3e8ee19def75d45272.tar.bz2
ENH: Add support for proxy authentication (thanks Jean-Michel)
Diffstat (limited to 'Source/CTest/cmCTestSubmit.cxx')
-rw-r--r--Source/CTest/cmCTestSubmit.cxx22
1 files changed, 21 insertions, 1 deletions
diff --git a/Source/CTest/cmCTestSubmit.cxx b/Source/CTest/cmCTestSubmit.cxx
index 34d53c9..3dbc1f7 100644
--- a/Source/CTest/cmCTestSubmit.cxx
+++ b/Source/CTest/cmCTestSubmit.cxx
@@ -27,6 +27,7 @@ cmCTestSubmit::cmCTestSubmit() : m_HTTPProxy(), m_FTPProxy()
m_Verbose = false;
m_HTTPProxy = "";
m_HTTPProxyType = 0;
+ m_HTTPProxyAuth = "";
if ( getenv("HTTP_PROXY") )
{
m_HTTPProxyType = 1;
@@ -53,6 +54,15 @@ cmCTestSubmit::cmCTestSubmit() : m_HTTPProxy(), m_FTPProxy()
m_HTTPProxyType = 3;
}
}
+ if ( getenv("HTTP_PROXY_USER") )
+ {
+ m_HTTPProxyAuth = getenv("HTTP_PROXY_USER");
+ }
+ if ( getenv("HTTP_PROXY_PASSWD") )
+ {
+ m_HTTPProxyAuth += ":";
+ m_HTTPProxyAuth += getenv("HTTP_PROXY_PASSWD");
+ }
}
m_FTPProxy = "";
m_FTPProxyType = 0;
@@ -223,7 +233,12 @@ bool cmCTestSubmit::SubmitUsingHTTP(const cmStdString& localprefix,
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
break;
default:
- curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
+ curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
+ if (m_HTTPProxyAuth.size() > 0)
+ {
+ curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD,
+ m_HTTPProxyAuth.c_str());
+ }
}
}
@@ -349,6 +364,11 @@ bool cmCTestSubmit::TriggerUsingHTTP(const std::vector<cmStdString>& files,
break;
default:
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
+ if (m_HTTPProxyAuth.size() > 0)
+ {
+ curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD,
+ m_HTTPProxyAuth.c_str());
+ }
}
}