diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-06-02 20:47:47 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2005-06-02 20:47:47 (GMT) |
commit | 8f6c1d3baaef242ffc70ec01017059cc53aed39d (patch) | |
tree | 687dc849795fc219bcd419d3413e00dacc7e246b /Source | |
parent | 2ab429b9bf687c12e302f11d81276d5c7c82c74c (diff) | |
download | CMake-8f6c1d3baaef242ffc70ec01017059cc53aed39d.zip CMake-8f6c1d3baaef242ffc70ec01017059cc53aed39d.tar.gz CMake-8f6c1d3baaef242ffc70ec01017059cc53aed39d.tar.bz2 |
BUG: Fix the order of things to make submit handler not crash when proxies are set
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestSubmitHandler.cxx | 145 | ||||
-rw-r--r-- | Source/cmCTest.cxx | 5 |
2 files changed, 77 insertions, 73 deletions
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index d1dbcf1..83127a7 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -62,79 +62,9 @@ cmCTestSubmitHandler::cmCTestSubmitHandler() : m_HTTPProxy(), m_FTPProxy() m_HTTPProxy = ""; m_HTTPProxyType = 0; m_HTTPProxyAuth = ""; - if ( getenv("HTTP_PROXY") ) - { - m_HTTPProxyType = 1; - m_HTTPProxy = getenv("HTTP_PROXY"); - if ( getenv("HTTP_PROXY_PORT") ) - { - m_HTTPProxy += ":"; - m_HTTPProxy += getenv("HTTP_PROXY_PORT"); - } - if ( getenv("HTTP_PROXY_TYPE") ) - { - cmStdString type = getenv("HTTP_PROXY_TYPE"); - // HTTP/SOCKS4/SOCKS5 - if ( type == "HTTP" ) - { - m_HTTPProxyType = 1; - } - else if ( type == "SOCKS4" ) - { - m_HTTPProxyType = 2; - } - else if ( type == "SOCKS5" ) - { - 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; - if ( getenv("FTP_PROXY") ) - { - m_FTPProxyType = 1; - m_FTPProxy = getenv("FTP_PROXY"); - if ( getenv("FTP_PROXY_PORT") ) - { - m_FTPProxy += ":"; - m_FTPProxy += getenv("FTP_PROXY_PORT"); - } - if ( getenv("FTP_PROXY_TYPE") ) - { - cmStdString type = getenv("FTP_PROXY_TYPE"); - // HTTP/SOCKS4/SOCKS5 - if ( type == "HTTP" ) - { - m_FTPProxyType = 1; - } - else if ( type == "SOCKS4" ) - { - m_FTPProxyType = 2; - } - else if ( type == "SOCKS5" ) - { - m_FTPProxyType = 3; - } - } - } - if ( m_HTTPProxy.size() > 0 ) - { - cmCTestLog(m_CTest, HANDLER_OUTPUT, " Use HTTP Proxy: " << m_HTTPProxy << std::endl); - } - if ( m_FTPProxy.size() > 0 ) - { - cmCTestLog(m_CTest, HANDLER_OUTPUT, " Use FTP Proxy: " << m_FTPProxy << std::endl); - } } //---------------------------------------------------------------------------- @@ -690,6 +620,79 @@ int cmCTestSubmitHandler::ProcessHandler() return -1; } + if ( getenv("HTTP_PROXY") ) + { + m_HTTPProxyType = 1; + m_HTTPProxy = getenv("HTTP_PROXY"); + if ( getenv("HTTP_PROXY_PORT") ) + { + m_HTTPProxy += ":"; + m_HTTPProxy += getenv("HTTP_PROXY_PORT"); + } + if ( getenv("HTTP_PROXY_TYPE") ) + { + cmStdString type = getenv("HTTP_PROXY_TYPE"); + // HTTP/SOCKS4/SOCKS5 + if ( type == "HTTP" ) + { + m_HTTPProxyType = 1; + } + else if ( type == "SOCKS4" ) + { + m_HTTPProxyType = 2; + } + else if ( type == "SOCKS5" ) + { + 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"); + } + } + + if ( getenv("FTP_PROXY") ) + { + m_FTPProxyType = 1; + m_FTPProxy = getenv("FTP_PROXY"); + if ( getenv("FTP_PROXY_PORT") ) + { + m_FTPProxy += ":"; + m_FTPProxy += getenv("FTP_PROXY_PORT"); + } + if ( getenv("FTP_PROXY_TYPE") ) + { + cmStdString type = getenv("FTP_PROXY_TYPE"); + // HTTP/SOCKS4/SOCKS5 + if ( type == "HTTP" ) + { + m_FTPProxyType = 1; + } + else if ( type == "SOCKS4" ) + { + m_FTPProxyType = 2; + } + else if ( type == "SOCKS5" ) + { + m_FTPProxyType = 3; + } + } + } + + if ( m_HTTPProxy.size() > 0 ) + { + cmCTestLog(m_CTest, HANDLER_OUTPUT, " Use HTTP Proxy: " << m_HTTPProxy << std::endl); + } + if ( m_FTPProxy.size() > 0 ) + { + cmCTestLog(m_CTest, HANDLER_OUTPUT, " Use FTP Proxy: " << m_FTPProxy << std::endl); + } cmGeneratedFileStream ofs; m_CTest->OpenOutputFile("Temporary", "LastSubmit.log", ofs); diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 740a7d6..942f770 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -219,7 +219,10 @@ cmCTest::cmCTest() m_TimeOut = 0; m_CompressXMLFiles = false; m_CTestConfigFile = ""; + m_OutputLogFile = 0; + m_OutputLogFileLastTag = -1; m_SuppressUpdatingCTestConfiguration = false; + int cc; for ( cc=0; cc < cmCTest::LAST_TEST; cc ++ ) { @@ -241,8 +244,6 @@ cmCTest::cmCTest() { it->second->SetCTestInstance(this); } - m_OutputLogFile = 0; - m_OutputLogFileLastTag = -1; } cmCTest::~cmCTest() |