Files
@ 29523bdabd5d
Branch filter:
Location: libtransport.git/src/HTTPRequestQueue.cpp - annotation
29523bdabd5d
709 B
text/x-c++hdr
Merge branch 'master' of github.com:hanzz/libtransport
5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 5adb3d1f9733 | #include "transport/HTTPRequestQueue.h"
#include "transport/HTTPRequest.h"
namespace Transport {
DEFINE_LOGGER(logger, "HTTPRequestQueue")
HTTPRequestQueue::HTTPRequestQueue(int delay) {
m_delay = delay;
m_processing = false;
}
HTTPRequestQueue::~HTTPRequestQueue() {
}
void HTTPRequestQueue::sendNextRequest() {
if (m_queue.empty()) {
m_processing = false;
return;
}
if (m_processing) {
return;
}
HTTPRequest *req = m_queue.front();
m_queue.pop();
req->onRequestFinished.connect(boost::bind(&HTTPRequestQueue::sendNextRequest, this));
req->execute();
}
void HTTPRequestQueue::queueRequest(HTTPRequest *req) {
m_queue.push(req);
if (!m_processing) {
sendNextRequest();
}
}
}
|