From 74ebe2acdde7daebf4c6a610e105b3e7c1e3182c Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Tue, 12 Nov 2013 18:32:36 -0800 Subject: [PATCH] TS-2316: properly cherry-pick client header condition fix This commit was cherry-picked with some errors: header_rewrite: fix for crash in client header condition Pointy hat to: me (aivanov@) --- plugins/header_rewrite/conditions.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/header_rewrite/conditions.cc b/plugins/header_rewrite/conditions.cc index 25bbae6d304..f57e6e9c2ed 100644 --- a/plugins/header_rewrite/conditions.cc +++ b/plugins/header_rewrite/conditions.cc @@ -192,10 +192,10 @@ ConditionHeader::append_value(std::string& s, const Resources& res) field_loc = TSMimeHdrFieldFind(bufp, hdr_loc, _qualifier.c_str(), _qualifier.size()); TSDebug(PLUGIN_NAME, "Getting Header: %s, field_loc: %p", _qualifier.c_str(), field_loc); if (field_loc != NULL) { - value = TSMimeHdrFieldValueStringGet(bufp, res.hdr_loc, field_loc, 0, &len); + value = TSMimeHdrFieldValueStringGet(bufp, hdr_loc, field_loc, 0, &len); TSDebug(PLUGIN_NAME, "Appending HEADER(%s) to evaluation value -> %.*s", _qualifier.c_str(), len, value); s.append(value, len); - TSHandleMLocRelease(bufp, res.hdr_loc, field_loc); + TSHandleMLocRelease(bufp, hdr_loc, field_loc); } } }