[
https://issues.apache.org/jira/browse/TS-3816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15363366#comment-15363366
]
ASF GitHub Bot commented on TS-3816:
------------------------------------
Github user zwoop commented on a diff in the pull request:
https://github.com/apache/trafficserver/pull/783#discussion_r69647327
--- Diff: proxy/StatPages.cc ---
@@ -83,7 +83,7 @@ StatPagesManager::handle_http(Continuation *cont, HTTPHdr
*header)
host_len = unescapifyStr(host);
for (i = 0; i < n_stat_pages; i++) {
- if (ptr_len_cmp(host, host_len, stat_pages[i].module) == 0) {
+ if ((host_len == sizeof(stat_pages[i].module)) && (memcmp(host,
stat_pages[i].module, host_len) == 0)) {
--- End diff --
Aha. The damn thing is overloaded. Yeah, we have to do something like what
James is suggesting here.
> Should we replace ptr_len_cmp() with memcmp() consistently?
> -----------------------------------------------------------
>
> Key: TS-3816
> URL: https://issues.apache.org/jira/browse/TS-3816
> Project: Traffic Server
> Issue Type: Improvement
> Components: Core
> Reporter: Leif Hedstrom
> Assignee: Tyler Stroh
> Labels: newbie++
> Fix For: sometime
>
>
> In most places, we already use memcmp(), but we have our own implementation /
> wrapper named ptr_len_cmp(), which is used in a few places. This seems rather
> inconsistent, so either we use ptr_len_cmp() consistently, or just use
> memcmp() across the board.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)