mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Fix url parsing.
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include "HttpsClient.h"
|
#include "HttpsClient.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
@@ -94,7 +95,7 @@ void HttpsClient::handleDeadline(const boost::system::error_code& ecResult)
|
|||||||
// Timer canceled because deadline no longer needed.
|
// Timer canceled because deadline no longer needed.
|
||||||
// std::cerr << "Deadline cancelled." << std::endl;
|
// std::cerr << "Deadline cancelled." << std::endl;
|
||||||
|
|
||||||
// nothing(); // Aborter is done.
|
nothing(); // Aborter is done.
|
||||||
}
|
}
|
||||||
else if (ecResult)
|
else if (ecResult)
|
||||||
{
|
{
|
||||||
@@ -136,7 +137,7 @@ void HttpsClient::handleResolve(
|
|||||||
|
|
||||||
if (mShutdown)
|
if (mShutdown)
|
||||||
{
|
{
|
||||||
std::cerr << "Resolve error: " << mDeqSites[0] << ": " << mShutdown.message() << std::endl;
|
// std::cerr << "Resolve error: " << mDeqSites[0] << ": " << mShutdown.message() << std::endl;
|
||||||
|
|
||||||
invokeComplete(mShutdown);
|
invokeComplete(mShutdown);
|
||||||
}
|
}
|
||||||
@@ -266,7 +267,7 @@ void HttpsClient::handleData(const boost::system::error_code& ecResult)
|
|||||||
if (mShutdown)
|
if (mShutdown)
|
||||||
{
|
{
|
||||||
// std::cerr << "Complete." << std::endl;
|
// std::cerr << "Complete." << std::endl;
|
||||||
// nothing();
|
nothing();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -364,7 +365,7 @@ void HttpsClient::httpsGet(
|
|||||||
|
|
||||||
bool HttpsClient::httpsParseUrl(const std::string strUrl, std::string& strDomain, std::string& strPath)
|
bool HttpsClient::httpsParseUrl(const std::string strUrl, std::string& strDomain, std::string& strPath)
|
||||||
{
|
{
|
||||||
static boost::regex reUrl("(?i)\\`https://([^/]+)(/.*)\\'"); // https://DOMAINPATH
|
static boost::regex reUrl("(?i)\\`\\s*https://([^/]+)(/.*)\\s*\\'"); // https://DOMAINPATH
|
||||||
|
|
||||||
boost::smatch smMatch;
|
boost::smatch smMatch;
|
||||||
|
|
||||||
@@ -373,8 +374,9 @@ bool HttpsClient::httpsParseUrl(const std::string strUrl, std::string& strDomain
|
|||||||
if (bMatch)
|
if (bMatch)
|
||||||
{
|
{
|
||||||
strDomain = smMatch[1];
|
strDomain = smMatch[1];
|
||||||
strDomain = smMatch[2];
|
strPath = smMatch[2];
|
||||||
}
|
}
|
||||||
|
// std::cerr << strUrl << " : " << bMatch << " : '" << strDomain << "' : '" << strPath << "'" << std::endl;
|
||||||
|
|
||||||
return bMatch;
|
return bMatch;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user