Hi all,
  the attached patch is a build- and run-tested merge proposal for next
round of the coverity-fixes branch, currently focusing on more effective
header name -> id lookups.

Here's the status with the current todo checklist:

 * DONE 1. shift HDR_BAD_HDR to end of enum
 * DONE 2. shift headers data array to http/RegistredHeaders.cc
 * DONE 3. creatign LookupTable object from teh enum and array
 * (with HDR_BAD_HDR as invalid value)
 * DONE 4. replacing httpHeaderIdByName() uses with the lookup table
 * NOT POSSIBLE 5. merge HDR_BAD_HDR and HDR_ENUM_END into one thing -
HDR_ENUM_END is overloaded meaning "All" headers in Manglers.
 * DONE 6. replacing httpHeaderNameById with direct array lookups
 * DONE 7. being looking at the other arrays removal

In working on this I found out several instances of enum abuses - tracking
those down has been the hardest part of the effort.
HttpHeader::parse is being used to parse error page templates - thus the
relaxed any_registered_header() checks in some methods, e.g.
HttpHdeader::addEntry().

Next steps, if there is consensus:
- moving LookupTable away from std::map to std::hash with custom
gperf-derived Hashers for extra boost
- investigating whether strongly-typed enums can be used instead of C-style
enums in more places.
- moving away from homegrown bitfields (CBIT_TEST etc.) towards
std::vector<bool> or std::vector<unsigned char>, possibly via a class
bitfield or somesuch.

-- 
    Francesco

Attachment: coverity-fixes-3-v2.patch
Description: Binary data

_______________________________________________
squid-dev mailing list
[email protected]
http://lists.squid-cache.org/listinfo/squid-dev

Reply via email to