#if USE_HTCP
if (p->options.htcp) {
os << " htcp";
- if (p->options.htcp_oldsquid || p->options.htcp_no_clr || p->options.htcp_no_purge_clr || p->options.htcp_only_clr) {
- bool doneopts = false;
- if (p->options.htcp_oldsquid) {
- os << (doneopts ? ',' : '=') << "oldsquid";
- doneopts = true;
- }
- if (p->options.htcp_no_clr) {
- os << (doneopts ? ',' : '=') << "no-clr";
- doneopts = true;
- }
- if (p->options.htcp_no_purge_clr) {
- os << (doneopts ? ',' : '=') << "no-purge-clr";
- doneopts = true;
- }
- if (p->options.htcp_only_clr) {
- os << (doneopts ? ',' : '=') << "only-clr";
- //doneopts = true; // uncomment if more opts are added
- }
- }
+ std::vector<const char *, PoolingAllocator<const char *> > opts;
+ if (p->options.htcp_oldsquid)
+ opts.push_back("oldsquid");
+ if (p->options.htcp_no_clr)
+ opts.push_back("no-clr");
+ if (p->options.htcp_no_purge_clr)
+ opts.push_back("no-purge-clr");
+ if (p->options.htcp_only_clr)
+ opts.push_back("only-clr");
+ if (p->options.htcp_forward_clr)
+ opts.push_back("forward-clr");
+ os << AsList(opts).prefixedBy("=").delimitedBy(",");
}
#endif