[
https://issues.apache.org/jira/browse/TS-3155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14202696#comment-14202696
]
Susan Hinrichs commented on TS-3155:
------------------------------------
ts-3155.patch contains the additions of value_get_index methods to MIMEField
and MIMEHdr.
It is used in is_header_keep_alive in HttpTransact.cc.
It could be used in a number of different places, but I didn't want to make all
the changes on this issue, particularly since I was not sure how to test all of
those cases. In particular, any use of MIMEField::value_get_comma_list()
should be re-examined. If all the code needs to do is test that a particular
value is present in the field, value_get_index should be used instead as a more
efficient alternative.
> Add a value test method to the MIMEField class
> ----------------------------------------------
>
> Key: TS-3155
> URL: https://issues.apache.org/jira/browse/TS-3155
> Project: Traffic Server
> Issue Type: Improvement
> Components: Core
> Reporter: Susan Hinrichs
> Assignee: Susan Hinrichs
> Fix For: 5.2.0
>
> Attachments: ts-3155.patch
>
>
> In some cases, you don't need to directly manipulate the strings of values in
> a mime field. But you do need to test if a mime field contains a value (e.g.
> does the Connection field contain the value "close").
> Currently, you must call MIMEField::value_get, but that does a bunch of
> copies and string allocation which is not needed in our case. We propose
> adding a MIMEField::value_get_index method which returns the index of the
> value in the list if it is present and -1 otherwise. Will still need to do
> the string parsing, but do not need to do the copies and allocation.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)