Rename AICurlResponderBufferEvents to AIBufferedCurlEasyRequestEvents
Since we changed CurlResponderBuffer to be derived from CurlEasyRequest and therefore changed it's name to BufferedCurlEasyRequest, we should also rename AICurlResponderBufferEvents to AIBufferedCurlEasyRequestEvents. This commit also fixes C++ comment in several places to reflex the previous name change.
This commit is contained in:
@@ -592,7 +592,7 @@ void AIStateMachine::flush(void)
|
||||
AIStateMachine& statemachine(iter->statemachine());
|
||||
if (statemachine.abortable())
|
||||
{
|
||||
// We can't safely call abort() here for non-running (run() was called, but they we're initialized yet) statemachines,
|
||||
// We can't safely call abort() here for non-running (run() was called, but they weren't initialized yet) statemachines,
|
||||
// because that might call kill() which in some cases is undesirable (ie, when it is owned by a partent that will
|
||||
// also call abort() on it when it is aborted itself).
|
||||
if (statemachine.running())
|
||||
|
||||
@@ -94,7 +94,7 @@ class HTTPTimeout : public LLRefCount {
|
||||
// Accessor.
|
||||
bool has_stalled(void) const { return mStalled < sClockCount; }
|
||||
|
||||
// Called from CurlResponderBuffer::processOutput if a timeout occurred.
|
||||
// Called from BufferedCurlEasyRequest::processOutput if a timeout occurred.
|
||||
void print_diagnostics(CurlEasyRequest const* curl_easy_request);
|
||||
|
||||
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
|
||||
@@ -444,7 +444,7 @@ class BufferedCurlEasyRequest : public CurlEasyRequest {
|
||||
//void setBodyLimit(U32 size) { mBodyLimit = size; }
|
||||
|
||||
// Post-initialization, set the parent to pass the events to.
|
||||
void send_buffer_events_to(AICurlResponderBufferEvents* target) { mBufferEventsTarget = target; }
|
||||
void send_buffer_events_to(AIBufferedCurlEasyRequestEvents* target) { mBufferEventsTarget = target; }
|
||||
|
||||
protected:
|
||||
// Events from this class.
|
||||
@@ -462,7 +462,7 @@ class BufferedCurlEasyRequest : public CurlEasyRequest {
|
||||
std::string mReason; // The "reason" from the same header line.
|
||||
S32 mRequestTransferedBytes;
|
||||
S32 mResponseTransferedBytes;
|
||||
AICurlResponderBufferEvents* mBufferEventsTarget;
|
||||
AIBufferedCurlEasyRequestEvents* mBufferEventsTarget;
|
||||
|
||||
public:
|
||||
static LLChannelDescriptors const sChannels; // Channel object for mInput (channel out()) and mOutput (channel in()).
|
||||
|
||||
@@ -81,7 +81,7 @@ class MultiHandle : public CurlMultiHandle
|
||||
// Store result and trigger events for easy request.
|
||||
void finish_easy_request(AICurlEasyRequest const& easy_request, CURLcode result);
|
||||
// Remove easy request at iter (must exist).
|
||||
// Note that it's possible that a new request from mQueuedRequests is inserted before iter.
|
||||
// Note that it's possible that a new request from a PerHostRequestQueue::mQueuedRequests is inserted before iter.
|
||||
CURLMcode remove_easy_request(addedEasyRequests_type::iterator const& iter, bool as_per_command);
|
||||
|
||||
static int socket_callback(CURL* easy, curl_socket_t s, int action, void* userp, void* socketp);
|
||||
|
||||
@@ -59,8 +59,8 @@ struct AITransferInfo {
|
||||
F64 mSpeedDownload;
|
||||
};
|
||||
|
||||
// Events generated by AICurlPrivate::CurlResponderBuffer.
|
||||
struct AICurlResponderBufferEvents {
|
||||
// Events generated by AICurlPrivate::BufferedCurlEasyRequest
|
||||
struct AIBufferedCurlEasyRequestEvents {
|
||||
virtual void received_HTTP_header(void) = 0; // For example "HTTP/1.0 200 OK", the first header of a reply.
|
||||
virtual void received_header(std::string const& key, std::string const& value) = 0; // Subsequent headers.
|
||||
virtual void completed_headers(U32 status, std::string const& reason, AITransferInfo* info) = 0; // Transaction completed.
|
||||
@@ -79,13 +79,13 @@ public:
|
||||
* The life cycle of classes derived from this class is as follows:
|
||||
* They are allocated with new on the line where get(), getByteRange() or post() is called,
|
||||
* and the pointer to the allocated object is then put in a reference counting ResponderPtr.
|
||||
* This ResponderPtr is passed to CurlResponderBuffer::prepRequest which stores it in its
|
||||
* This ResponderPtr is passed to BufferedCurlEasyRequest::prepRequest which stores it in its
|
||||
* member mResponder. Hence, the life time of a Responder is never longer than its
|
||||
* associated CurlResponderBuffer, however, if everything works correctly, then normally a
|
||||
* responder is deleted in CurlResponderBuffer::removed_from_multi_handle by setting
|
||||
* associated BufferedCurlEasyRequest, however, if everything works correctly, then normally a
|
||||
* responder is deleted in BufferedCurlEasyRequest::processOutput by setting
|
||||
* mReponder to NULL.
|
||||
*/
|
||||
class ResponderBase : public AICurlResponderBufferEvents {
|
||||
class ResponderBase : public AIBufferedCurlEasyRequestEvents {
|
||||
public:
|
||||
typedef boost::shared_ptr<LLBufferArray> buffer_ptr_t;
|
||||
|
||||
@@ -121,7 +121,7 @@ public:
|
||||
std::string const& getURL(void) const { return mURL; }
|
||||
CURLcode result_code(void) const { return mCode; }
|
||||
|
||||
// Called by CurlResponderBuffer::timed_out or CurlResponderBuffer::processOutput.
|
||||
// Called by BufferedCurlEasyRequest::timed_out or BufferedCurlEasyRequest::processOutput.
|
||||
virtual void finished(CURLcode code, U32 http_status, std::string const& reason, LLChannelDescriptors const& channels, buffer_ptr_t const& buffer) = 0;
|
||||
|
||||
// Return true if the curl thread is done with this transaction.
|
||||
@@ -132,7 +132,7 @@ public:
|
||||
bool is_finished(void) const { return mFinished; }
|
||||
|
||||
protected:
|
||||
// AICurlResponderBufferEvents
|
||||
// AIBufferedCurlEasyRequestEvents
|
||||
|
||||
// Called when the "HTTP/1.x <status> <reason>" header is received.
|
||||
/*virtual*/ void received_HTTP_header(void)
|
||||
|
||||
Reference in New Issue
Block a user