On 2025-02-07 18:41, Jonathan Lee wrote:

Can someone show me an example of doing one of these requests on the to do list?

Please direct future development questions and followups to squid-dev mailing list! This squid-users mailing list is meant for Squid operators or administrators rather than developers.


Do anyone have an example plus the section of the code on gethub needs all the changes, (I am a student, and the code base is massive) What I am looking for is a single example and I will do more of them.

These TODOs may be too difficult to implement and test correctly without understanding of smart pointers and associated pitfalls, but you can look through past git commits to find similar pointer conversion examples:

* f05e4f37: Upgrade ACLFilledChecklist::request to smart Pointer
* 2d5ac435: Do not use raw pointers to index sourcehash CachePeers
* e7959b56: Do not use raw pointers to index CARP CachePeers
* d603e3c2: Cleanup: make Client::request a Pointer
* a0c227a9: Cleanup: convert MemObject::_reply to ReplyPointer
* c43405e7: Cleanup: convert MemObject::request to Pointer

Disclaimer: I have used commit messages to find the examples above. I did not revisit each commit to assess whether it is indeed a good example for the remaining TODOs quoted below.

If you decide to convert a raw pointer, my recommendation is to start with a class data member that is _not_ used in many places, so that you do not have to modify a lot of code. However, that recommendation alone is probably enough to avoid the pitfalls often present in such conversions!


HTH,

Alex.


On Squid's easy to do list it states...

 1. update a /HttpRequest/ raw pointer to a |HttpRequest::Pointer|.
    Including all code performing locking on it
 2. update a |HttpReply| raw pointer to a |HttpReply::Pointer|.
    Including all code performing locking on it
 3. update a |HttpMsg| raw pointer to a |HttpMsg::Pointer|. Including
    all code performing locking on it
 4. update a CBDATA raw pointer to a CbcPointer. Including all code
    performing validation tests and locking on it.


_______________________________________________
squid-users mailing list
squid-users@lists.squid-cache.org
https://lists.squid-cache.org/listinfo/squid-users

Reply via email to