[squid-dev] [PATCH] Coverity(-inspired) fixes part four, HttpHeader refactor

Kinkie gkinkie at gmail.com
Sun Aug 16 07:09:45 UTC 2015


Hi all,
  the attached patch does:
- EnumIterator, which now uses autoconf to detect std::underlying_type
- Removes header masks in HttpHeader.cc and HttpReply in favor of..
- gperf-generated header table with flags describing headers all collected
in one place
- replaces HttpHeader::getEntry with explicit vector iteration
- Implements and uses Http::HeaderTable.lookup(string-or-Http::HdrType) to
look up headers in the gperf-generated hash
- small optimizationi in HttpHeader::getLastEntry thanks to reverse
iterators
- use erase-remove pattern in HttpHeader::compact in place of resize()
- use std:: algorithms instead of explicit loop in HttpHeader::delById
- gets rid of httpHeaderCalcMask - masks are still used elsewhere but
generating them is now easier thanks to WholeEnum<type>
- some readability improvements
- refactor HeaderManglers::track to avoid overloading of meaning the
enumEnd_ enumerator - please help me checking carefully I haven't altered
functionality here
- implements a case-insensitve hash function for SBuf
- all known headers are now unconditionally parsed. May not be acted upon
if some functions are not compiled in
- LookupTable now uses an unordered_map instead of map for backing storage.
No user-visible change for SBuf and std::string users unless they wish to
have a custom hasher

Most code has been run-tested (most notable exception: HeaderManglers),
farm-build-, coadvisor- and polygraph- tested. The main focus of this
refactoring is correctness and readability, c++11-ification and recovering
from the performance regression that was introduced ~10 days ago.

-- 
    Francesco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20150816/be69eab2/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: coverity-fixes-4-v1.patch
Type: application/octet-stream
Size: 161279 bytes
Desc: not available
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20150816/be69eab2/attachment-0001.obj>


More information about the squid-dev mailing list