Hm I must be missing something. Where does the fetcher get cleaned up if not here? ngx_url_async_fetcher_ is just a bare pointer, not a scoped_ptr. Where does ownership of the fetcher get passed to the base RewriteDriverFactory?

This block looks a little wonky to begin with. If serf is being used, then when does the RateControllingUrlSyncFetcher get deleted? And if the native fetcher is used, it looks like only the RateControllingUrlAsyncFetcher is deleted, not the native fetcher.