|
|
@ -252,7 +252,7 @@ static std::string RequestMethodString(HTTPRequest::RequestMethod m) |
|
|
|
/** HTTP request callback */ |
|
|
|
/** HTTP request callback */ |
|
|
|
static void http_request_cb(struct evhttp_request* req, void* arg) |
|
|
|
static void http_request_cb(struct evhttp_request* req, void* arg) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::auto_ptr<HTTPRequest> hreq(new HTTPRequest(req)); |
|
|
|
std::unique_ptr<HTTPRequest> hreq(new HTTPRequest(req)); |
|
|
|
|
|
|
|
|
|
|
|
LogPrint("http", "Received a %s request for %s from %s\n", |
|
|
|
LogPrint("http", "Received a %s request for %s from %s\n", |
|
|
|
RequestMethodString(hreq->GetRequestMethod()), hreq->GetURI(), hreq->GetPeer().ToString()); |
|
|
|
RequestMethodString(hreq->GetRequestMethod()), hreq->GetURI(), hreq->GetPeer().ToString()); |
|
|
@ -288,7 +288,7 @@ static void http_request_cb(struct evhttp_request* req, void* arg) |
|
|
|
|
|
|
|
|
|
|
|
// Dispatch to worker thread
|
|
|
|
// Dispatch to worker thread
|
|
|
|
if (i != iend) { |
|
|
|
if (i != iend) { |
|
|
|
std::auto_ptr<HTTPWorkItem> item(new HTTPWorkItem(hreq.release(), path, i->handler)); |
|
|
|
std::unique_ptr<HTTPWorkItem> item(new HTTPWorkItem(hreq.release(), path, i->handler)); |
|
|
|
assert(workQueue); |
|
|
|
assert(workQueue); |
|
|
|
if (workQueue->Enqueue(item.get())) |
|
|
|
if (workQueue->Enqueue(item.get())) |
|
|
|
item.release(); /* if true, queue took ownership */ |
|
|
|
item.release(); /* if true, queue took ownership */ |
|
|
|