----- Original Message ----- > [TS-2321] C++ API: Clean up header code to no longer use intermediate data > structures
[snip] > Branch: refs/heads/master > Commit: 83d43ab13eddb893d9186121a6a7c5caae86e793 > Parents: b984db3 > Author: Brian Geffon <bri...@apache.org> [snip] > ---------------------------------------------------------------------- > diff --git a/CHANGES b/CHANGES > index eb88d11..eef9793 100644 > --- a/CHANGES > +++ b/CHANGES > @@ -1,6 +1,6 @@ > -*- coding: utf-8 > -*- > Changes with Apache Traffic Server 4.1.0 > - > + *) [TS-2321] C++ API: Clean up header code to not use STL containers and > use structures directly > > *) [TS-2323] Implement a .include directive for remap.config. > [snip] > diff --git a/lib/atscppapi/examples/Makefile.am > b/lib/atscppapi/examples/Makefile.am > index 7a48ad0..23c9c70 100644 > --- a/lib/atscppapi/examples/Makefile.am > +++ b/lib/atscppapi/examples/Makefile.am > @@ -27,12 +27,10 @@ SUBDIRS = helloworld \ > null_transformation_plugin \ > post_buffer \ > logger_example \ > - detachedrequest \ > stat_example \ > remap_plugin \ > async_http_fetch \ > gzip_transformation \ > timeout_example \ > internal_transaction_handling \ > - async_timer \ > - request_cookies I think we've got an issue here with tabbing. [snip] > diff --git a/lib/atscppapi/src/AsyncHttpFetch.cc > b/lib/atscppapi/src/AsyncHttpFetch.cc > index 3fd798d..7f40dd2 100644 > --- a/lib/atscppapi/src/AsyncHttpFetch.cc > +++ b/lib/atscppapi/src/AsyncHttpFetch.cc > @@ -130,13 +130,14 @@ void > AsyncHttpFetch::run(shared_ptr<AsyncDispatchControllerBase> sender) { > request_str += HTTP_VERSION_STRINGS[state_->request_.getVersion()]; > request_str += "\r\n"; > > - for (Headers::const_iterator iter = state_->request_.getHeaders().begin(), > + /* for (Headers::const_iterator iter = > state_->request_.getHeaders().begin(), > end = state_->request_.getHeaders().end(); iter != end; ++iter) { > request_str += iter->first; > request_str += ": "; > request_str += Headers::getJoinedValues(iter->second); > request_str += "\r\n"; > } > +*/ Not a huge fan of just commenting code out. If it's broken or useless, remove it, that's what a VCS is for. > request_str += "\r\n"; > > LOG_DEBUG("Issing TSFetchUrl with request\n[%s]", request_str.c_str()); > > http://git-wip-us.apache.org/repos/asf/trafficserver/blob/83d43ab1/lib/atscppapi/src/Headers.cc > ---------------------------------------------------------------------- > diff --git a/lib/atscppapi/src/Headers.cc b/lib/atscppapi/src/Headers.cc > index cad277e..2c061da 100644 > --- a/lib/atscppapi/src/Headers.cc > +++ b/lib/atscppapi/src/Headers.cc [snip] > -Headers::size_type Headers::erase(const string &k) { > - if (!checkAndInitHeaders()) { > - return 0; > - } > - if ((state_->type_ == TYPE_REQUEST) && > (CaseInsensitiveStringComparator()(k, "Cookie") == 0)) { > - state_->request_cookies_.getValueRef().clear(); > - state_->request_cookies_.setInitialized(false); > - } else if ((state_->type_ == TYPE_RESPONSE) && > (CaseInsensitiveStringComparator()(k, "Set-Cookie") == 0)) { > - state_->response_cookies_.getValueRef().clear(); > - state_->response_cookies_.setInitialized(false); > +std::string HeaderField::operator[](const int index) { > + return *header_field_value_iterator(state_->hdr_buf_, state_->hdr_loc_, > state_->field_loc_, index); Really confused about what this code was doing and why it's removed now. "Cleanup" is a rather weak explanation. Please comment on such changes not only in the Jira, but also in the commit message, such that one can reason about it when looking at a git log/blame. [snip] ++ i Igor Galić Tel: +43 (0) 664 886 22 883 Mail: i.ga...@brainsware.org URL: http://brainsware.org/ GPG: 8716 7A9F 989B ABD5 100F 4008 F266 55D6 2998 1641