This simplifies the code a bit because if (p) { delete p; p = nullptr; } can be replaced by a call to the reset() member.
refactor: Make httpserver work queue a unique_ptr #22361
pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2106-httpRefactor changing 1 files +12 −14-
MarcoFalke commented at 9:51 AM on June 28, 2021: member
-
refactor: Make httpserver work queue a unique_ptr fa92e60f38
- fanquake added the label Refactoring on Jun 28, 2021
-
promag commented at 9:54 AM on June 28, 2021: member
Concept ACK.
This simplifies the code a bit because
if (p) { delete p; p = nullptr; }can be replaced by a call to thereset()member.Just
delete pwould be fine, but agreeunique_ptris better. -
practicalswift commented at 10:29 AM on June 28, 2021: contributor
Concept ACK
Nice to see another naked
newget properly dressed :) -
promag commented at 1:02 PM on June 28, 2021: member
Core review ACK fa92e60f38cb109fe5a3c7acfe1017ffebc388cc.
-
jonatack commented at 1:35 PM on June 28, 2021: member
ACK fa92e60f38cb109fe5a3c7acfe1017ffebc388cc code review, debug build clean, ran test/functional/interface*.py tests locally as a sanity check
-
in src/httpserver.cpp:260 in fa92e60f38
255 | @@ -256,10 +256,10 @@ static void http_request_cb(struct evhttp_request* req, void* arg) 256 | // Dispatch to worker thread 257 | if (i != iend) { 258 | std::unique_ptr<HTTPWorkItem> item(new HTTPWorkItem(std::move(hreq), path, i->handler)); 259 | - assert(workQueue); 260 | - if (workQueue->Enqueue(item.get())) 261 | + assert(g_work_queue); 262 | + if (g_work_queue->Enqueue(item.get())) {
hebasto commented at 4:44 PM on June 28, 2021:if (Assert(g_work_queue)->Enqueue(item.get())) {hebasto approvedhebasto commented at 4:44 PM on June 28, 2021: memberACK fa92e60f38cb109fe5a3c7acfe1017ffebc388cc, I have reviewed the code and it looks OK, I agree it can be merged.
DrahtBot commented at 6:16 PM on June 28, 2021: member<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #19434 by promag
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
MarcoFalke merged this on Jun 29, 2021MarcoFalke closed this on Jun 29, 2021MarcoFalke deleted the branch on Jun 29, 2021sidhujag referenced this in commit 2f11abdb7d on Jun 29, 2021PastaPastaPasta referenced this in commit 94ff316d34 on Sep 21, 2021PastaPastaPasta referenced this in commit 701c5db53c on Sep 24, 2021kittywhiskers referenced this in commit b59187c348 on Oct 12, 2021gwillen referenced this in commit f7a568bd1c on Jun 1, 2022DrahtBot locked this on Aug 18, 2022Labels
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:14 UTC
More mirrored repositories can be found on mirror.b10c.me