Compile fix.

Move the destructor (and copy constructor while I was at it) to the .cpp
file in order to avoid instantiating the destructor of
boost::intrusive_ptr<ThreadSafeBufferedCurlEasyRequest> from a header,
which would require the class ThreadSafeBufferedCurlEasyRequest
to be defined in that header, which is unnecessary. In other words,
this avoid the need to include "aicurl.h" in headers using
AIPerService[Ptr].

Also fixed indentation of a comment.
This commit is contained in:
Aleric Inglewood
2013-04-30 20:23:42 +02:00
parent 2a9c48d8d3
commit 74023d5303
3 changed files with 14 additions and 2 deletions

View File

@@ -81,6 +81,15 @@ AIPerService::AIPerService(void) :
{
}
AIPerService::~AIPerService()
{
}
// Fake copy constructor.
AIPerService::AIPerService(AIPerService const&) : mHTTPBandwidth(0)
{
}
// url must be of the form
// (see http://www.ietf.org/rfc/rfc3986.txt Appendix A for definitions not given here):
//

View File

@@ -92,6 +92,9 @@ class AIPerService {
friend class AIThreadSafeSimpleDC<AIPerService>; //threadsafe_PerServiceRequestQueue
AIPerService(void);
public:
~AIPerService();
public:
typedef instance_map_type::iterator iterator;
typedef instance_map_type::const_iterator const_iterator;
@@ -159,7 +162,7 @@ class AIPerService {
private:
// Disallow copying.
AIPerService(AIPerService const&) : mHTTPBandwidth(0) { }
AIPerService(AIPerService const&);
};
namespace AICurlPrivate {

View File

@@ -305,7 +305,7 @@ class CurlEasyRequest : public CurlEasyHandle {
AIHTTPTimeoutPolicy const* mTimeoutPolicy;
std::string mLowercaseServicename; // Lowercase hostname:port (canonicalized) extracted from the url.
AIPerServicePtr mPerServicePtr; // Pointer to the corresponding AIPerService.
AIPerServicePtr mPerServicePtr; // Pointer to the corresponding AIPerService.
LLPointer<curlthread::HTTPTimeout> mTimeout;// Timeout administration object associated with last created CurlSocketInfo.
bool mTimeoutIsOrphan; // Set to true when mTimeout is not (yet) associated with a CurlSocketInfo.
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)