[ 
https://issues.apache.org/jira/browse/TS-3155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14205046#comment-14205046
 ] 

ASF GitHub Bot commented on TS-3155:
------------------------------------

Github user jpeach commented on the pull request:

    https://github.com/apache/trafficserver/pull/139#issuecomment-62421425
  
    This looks pretty good. Please use `strncasecmp() == 0` instead of 
`!strncasecmp()`. The former is easier to read and consistent with the rest of 
the code.
    
    I'm not sure whether `strncasecmp` is the right comparison operation here. 
The code in `MIME.cc` uses a mixture of `strcasecmp` and the `ParseRules` API. 
I suspect that `ptr_len_casecmp` would be the right API to use.
    
    I'm not sure how involved it would be, but please consider adding a 
regression test for this.


> 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)

Reply via email to