[
https://issues.apache.org/jira/browse/TS-4316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15467486#comment-15467486
]
Alan M. Carroll commented on TS-4316:
-------------------------------------
I don't see how changing {{MIME_FIELD_SLOTNUM_UNKNOWN}} to 16 will work, as
there are only 4 bits in which to store the value (which of course is why
{{MIME_FIELD_SLOTNUM_MASK}} is 0xF). In that context, -1 is simply a different
notation for 15.
The slot accelerators are an array index by magic header constants (stored in
the WKS data). For a header in this group there is a reserved slot in the
accelerators which always has some value. Looking at the code, it seems to me
that {{MIME_FIELD_SLOTNUM_UNKNOWN}}, 0xE, means "the header is present but not
in a known slot" which is quite different from 0xF which means "the header is
not present". If you look at {{mime_hdr_init_accelerators_and_presence_bits}}
you can it sets all the accelerator values to 0xF to indicate "not present".
To sum up, I don't think this can be changed without more substantial changes.
> 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: 7.0.0
>
>
> 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)