songgaoye opened a new pull request, #3606: URL: https://github.com/apache/brpc/pull/3606
### What problem does this PR solve? Issue Number: resolve Problem Summary: `HttpHeader` caches the first `Set-Cookie` value as a pointer into its `HeaderMap`. The pointer becomes stale when the map grows, and it points to the wrong header after `HttpHeader::Swap()`. `Clear()` also leaves the cached pointer stale. ### What is changed and the side effects? Changed: Refresh the cached first `Set-Cookie` pointer after `HeaderMap` growth and `HttpHeader::Swap()`, and clear it in `HttpHeader::Clear()`. Add regression coverage for map growth, `Swap()`, and `Clear()`. Side effects: * Performance effects: * Breaking backward compatibility: * * * ### Check List: * Please make sure your changes are compilable. * When providing us with a new feature, it is best to add related tests. * Please follow [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/1/4/code-of-conduct/). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
