Do not reuse connection as that feature seems to be broken

This commit is contained in:
Andy Cedilnik 2003-02-07 11:03:44 -05:00
parent a5f5f63c27
commit 579945c2e7
1 changed files with 26 additions and 26 deletions

View File

@ -98,36 +98,36 @@ bool cmCTestSubmit::SubmitUsingFTP(const std::string& localprefix,
/* In windows, this will init the winsock stuff */ /* In windows, this will init the winsock stuff */
::curl_global_init(CURL_GLOBAL_ALL); ::curl_global_init(CURL_GLOBAL_ALL);
/* get a curl handle */ std::string::size_type cc;
curl = curl_easy_init(); for ( cc = 0; cc < files.size(); cc ++ )
if(curl)
{ {
// Using proxy /* get a curl handle */
if ( m_FTPProxyType > 0 ) curl = curl_easy_init();
if(curl)
{ {
curl_easy_setopt(curl, CURLOPT_PROXY, m_FTPProxy.c_str()); // Using proxy
switch (m_FTPProxyType) if ( m_FTPProxyType > 0 )
{ {
case 2: curl_easy_setopt(curl, CURLOPT_PROXY, m_FTPProxy.c_str());
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4); switch (m_FTPProxyType)
break; {
case 3: case 2:
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5); curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
break; break;
default: case 3:
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
break;
default:
curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
}
} }
}
// enable uploading
// enable uploading ::curl_easy_setopt(curl, CURLOPT_UPLOAD, TRUE) ;
::curl_easy_setopt(curl, CURLOPT_UPLOAD, TRUE) ;
std::string::size_type cc;
for ( cc = 0; cc < files.size(); cc ++ )
{
std::string local_file = localprefix + "/" + files[cc]; std::string local_file = localprefix + "/" + files[cc];
std::string upload_as = url + "/" + remoteprefix + files[cc]; std::string upload_as = url + "/" + remoteprefix + files[cc];
struct stat st; struct stat st;
if ( ::stat(local_file.c_str(), &st) ) if ( ::stat(local_file.c_str(), &st) )
{ {
@ -158,9 +158,9 @@ bool cmCTestSubmit::SubmitUsingFTP(const std::string& localprefix,
::curl_global_cleanup(); ::curl_global_cleanup();
return false; return false;
} }
// always cleanup
::curl_easy_cleanup(curl);
} }
// always cleanup
::curl_easy_cleanup(curl);
} }
::curl_global_cleanup(); ::curl_global_cleanup();
return true; return true;