RequestContext::create should call onUnset callback
authorMirek Klimos <miro@fb.com>
Thu, 4 Aug 2016 19:09:50 +0000 (12:09 -0700)
committerFacebook Github Bot 7 <facebook-github-bot-7-bot@fb.com>
Thu, 4 Aug 2016 19:23:25 +0000 (12:23 -0700)
commitd89b4d34c1bb7d3dd7c1a8d6f2a58c148f0b122a
treecd30fc0da45d037654d62e0bdc5b9e1f577c4098
parent156f70334627e5a100283b5334c0a2121d5a45a2
RequestContext::create should call onUnset callback

Summary: melaniesubbiah introduced onSet / onUnset callbacks on RequestData in D3604948; we need unset() to be called when an RC is overriden with RequestContext::create() so that things work as expected. Also, change the order of calling onSet / onUnset - from RequestData perspective, it shouldn't look like there are two contexts set at the same time

Reviewed By: palmtenor

Differential Revision: D3667017

fbshipit-source-id: b9bfb858fe65ffb11de8e6d6f13b8f4cf6266bc9
folly/io/async/Request.cpp
folly/io/async/Request.h
folly/io/async/test/RequestContextTest.cpp