Skip to content

Commit

Permalink
Re #7480. Clear cppcheck warnings while I have the file open.
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellTaylor committed Jul 18, 2013
1 parent 65b8f66 commit a992a1d
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions Code/Mantid/Framework/Remote/src/RemoteJobManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,14 @@ HttpRemoteJobManager::HttpRemoteJobManager( const Poco::XML::Element* elem)
// serverErr string.
RemoteJobManager::JobManagerErrorCode HttpRemoteJobManager::startTransaction( std::string &transId, std::string &directory, std::string &serverErr)
{
JobManagerErrorCode reqErr = JM_OK;

// Create an HTTPS session
// TODO: Notice that we've set the context to VERIFY_NONE. I think that means we're not checking the SSL certificate that the server
// sends to us. That's BAD!!
Poco::Net::Context::Ptr context = new Poco::Net::Context(Poco::Net::Context::CLIENT_USE, "", "", "", Poco::Net::Context::VERIFY_NONE, 9, false, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
Poco::Net::HTTPSClientSession session( Poco::URI(m_serviceBaseUrl).getHost(), Poco::Net::HTTPSClientSession::HTTPS_PORT, context);
// We need to send a GET request to the server with a query string of "action=start"
Poco::Net::HTTPRequest req;
reqErr = initGetRequest( req, "/transaction", "action=start");
JobManagerErrorCode reqErr = initGetRequest( req, "/transaction", "action=start");
if ( reqErr != JM_OK)
{
return reqErr;
Expand Down Expand Up @@ -172,8 +170,6 @@ RemoteJobManager::JobManagerErrorCode HttpRemoteJobManager::startTransaction( st
// serverErr string.
RemoteJobManager::JobManagerErrorCode HttpRemoteJobManager::stopTransaction( std::string &transId, std::string &serverErr)
{
JobManagerErrorCode reqErr = JM_OK;

// Create an HTTPS session
// TODO: Notice that we've set the context to VERIFY_NONE. I think that means we're not checking the SSL certificate that the server
// sends to us. That's BAD!!
Expand All @@ -182,7 +178,7 @@ RemoteJobManager::JobManagerErrorCode HttpRemoteJobManager::stopTransaction( std
// We need to send a GET request to the server with a query string of "action=start"
Poco::Net::HTTPRequest req;
std::string queryString = "action=stop&transid=" + transId;
reqErr = initGetRequest( req, "/transaction", queryString);
JobManagerErrorCode reqErr = initGetRequest( req, "/transaction", queryString);
if ( reqErr != JM_OK)
{
return reqErr;
Expand Down Expand Up @@ -243,8 +239,6 @@ RemoteJobManager::JobManagerErrorCode HttpRemoteJobManager::listFiles( const std
std::vector<std::string> &listing,
std::string &serverErr)
{
JobManagerErrorCode reqErr = JM_OK;

// Create an HTTPS session
// TODO: Notice that we've set the context to VERIFY_NONE. I think that means we're not checking the SSL certificate that the server
// sends to us. That's BAD!!
Expand All @@ -254,7 +248,7 @@ RemoteJobManager::JobManagerErrorCode HttpRemoteJobManager::listFiles( const std
// We need to send a GET request to the server with a query string of "TransID=xxxxx&Action=query"
Poco::Net::HTTPRequest req;
std::string queryString = "Action=query&TransID=" + transId;
reqErr = initGetRequest( req, "/file_transfer", queryString);
JobManagerErrorCode reqErr = initGetRequest( req, "/file_transfer", queryString);
if ( reqErr != JM_OK)
{
return reqErr;
Expand Down Expand Up @@ -310,7 +304,7 @@ RemoteJobManager::JobManagerErrorCode HttpRemoteJobManager::listFiles( const std
std::string oneName;
(*itNames).getValue( oneName);
listing.push_back( oneName);
itNames++;
++itNames;
}

reqErr = JM_OK; // This should already be set, but just in case....
Expand Down Expand Up @@ -455,8 +449,6 @@ RemoteJobManager::JobManagerErrorCode HttpRemoteJobManager::downloadFile( const
const std::string &localFileName,
std::string &serverErr)
{
JobManagerErrorCode reqErr = JM_OK;

// Create an HTTPS session
// TODO: Notice that we've set the context to VERIFY_NONE. I think that means we're not checking the SSL certificate that the server
// sends to us. That's BAD!!
Expand All @@ -467,7 +459,7 @@ RemoteJobManager::JobManagerErrorCode HttpRemoteJobManager::downloadFile( const
Poco::Net::HTTPRequest req;
std::string queryString = "Action=download&TransID=" + transId + "&File=" + remoteFileName;
queryString += "&XDEBUG_SESSION_START=MWS"; // enable debugging of the remote PHP
reqErr = initGetRequest( req, "/file_transfer", queryString);
JobManagerErrorCode reqErr = initGetRequest( req, "/file_transfer", queryString);
if ( reqErr != JM_OK)
{
return reqErr;
Expand Down Expand Up @@ -581,7 +573,7 @@ Poco::Net::NameValueCollection HttpRemoteJobManager::getCookies()
while (it != m_cookies.end())
{
nvc.add( (*it).getName(), (*it).getValue());
it++;
++it;
}
return nvc;
}
Expand Down Expand Up @@ -1141,7 +1133,7 @@ bool MwsRemoteJobManager::jobStatusAll( std::vector<RemoteJob> &jobList,
}

}
it++;
++it;
}
}

Expand Down

0 comments on commit a992a1d

Please sign in to comment.