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

Masakazu Kitajo commented on TS-4316:
-------------------------------------

Maybe I misunderstand something, but it seems "Accept" header is stored in slot 
14.

HdrToken.h
{noformat}
#define MIME_SLOTID_ACCEPT 0
{noformat}

MIME.cc:1325
{noformat}
* thread #1: tid = 0x9207e, 0x00000001000130d6 
test_mime`mime_hdr_field_find(mh=0x000000010068b888, field_name_str="Accept", 
field_name_len=6) + 198 at MIME.cc:1325, queue = 'com.apple.main-thread', stop 
reason = step over
    frame #0: 0x00000001000130d6 
test_mime`mime_hdr_field_find(mh=0x000000010068b888, field_name_str="Accept", 
field_name_len=6) + 198 at MIME.cc:1325
   1322     if (slot_id != MIME_SLOTID_NONE) {
   1323       uint32_t slotnum = mime_hdr_get_accelerator_slotnum(mh, slot_id);
   1324 
-> 1325       if (slotnum != MIME_FIELD_SLOTNUM_UNKNOWN) {
   1326         MIMEField *f = _mime_hdr_field_list_search_by_slotnum(mh, 
slotnum);
   1327         ink_assert((f == NULL) || f->is_live());
   1328 #if TRACK_FIELD_FIND_CALLS
(lldb) p slotnum
(uint32_t) $6 = 14
{noformat}

> Slot accelerator doesn't effect under certain condition
> -------------------------------------------------------
>
>                 Key: TS-4316
>                 URL: https://issues.apache.org/jira/browse/TS-4316
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: MIME
>            Reporter: Masakazu Kitajo
>            Assignee: Alan M. Carroll
>             Fix For: sometime
>
>
> Slot accelerators seem to not effect if the stored slot number is 14 or 15.
> This is because {{mime_hdr_set_accelerators_and_presence_bits()}} regards 
> slot number 14+ as "unknown" and stores MIME_FIELD_SLOTNUM_UNKNOWN(14) to an 
> accelerator, and it causes slower search. Although there is no critical 
> effect, it would decreases performance slightly.
> The numbers, 14 and 15, comes from constants below in MIME.h:
> {code}
> #define MIME_FIELD_SLOTNUM_BITS 4
> #define MIME_FIELD_SLOTNUM_MASK ((1 << MIME_FIELD_SLOTNUM_BITS) - 1)
> #define MIME_FIELD_SLOTNUM_MAX (MIME_FIELD_SLOTNUM_MASK - 1)
> #define MIME_FIELD_SLOTNUM_UNKNOWN MIME_FIELD_SLOTNUM_MAX
> {code}
> MIME_FIELD_SLOTNUM_MASK is 15.
> MIME_FIELD_SLOTNUM_MAX is 14.
> MIME_FIELD_SLOTNUM_UNKNOWN is 14 too.
> Though it still needs more careful confirmation, it seems we can simply 
> change {{MIME_FIELD_SLOTNUM_UNKNOWN}} to the value of 
> {{MIME_FIELD_SLOTNUM_MASK}} (15). But we still cannot use 15.
> To use 15 as a valid slot number in slot accelerators, we need to change 
> {{MIME_FIELD_SLOTNUM_UNKNOWN}} to 16 or -1, however it would need to change 
> some codes also (not only the number).
> This bug has been found while I was tackling TS-4313.
> https://github.com/apache/trafficserver/pull/542#discussion-diff-58226891



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to