New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create an HTTP global state object #10175
Comments
You would still be passing around that one object, right? |
Yes. |
Should this state object include things like ex.
|
LoadData is a per-request object, so it would not be included. |
@jdm ok makes sense, currently I have:
included in the http global state object, should anything else be included/excluded? |
Add Http Global State Object This adds a new HttpState object which holds common http state(#10175). This reduces the amount of work that is required to add extra things to the Http state. The HttpState object currently holds: ``` hsts_list: Arc::new(RwLock::new(HSTSList::new())), cookie_jar: Arc::new(RwLock::new(CookieStorage::new())), auth_cache: Arc::new(RwLock::new(HashMap::new())), ``` <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10188) <!-- Reviewable:end -->
Issue resolved in PR #10188. |
We pass around stuff like the cookie storage, the HSTS list, the HTTP authentication cache, etc. in
http_loader.rs
. This also means that the unit tests have a lot of repeated initialization code that creates these objects even when they're not used. I propose we wrap them up in a struct and give it a argument-less constructor to make reading the code easier and require fewer changes when adding additional global HTTP state.Code:
components/net/http_loader.rs
,components/net/resource_thread.rs
,tests/unit/net/http_loader.rs
The text was updated successfully, but these errors were encountered: