Commit graph

332 commits

Author SHA1 Message Date
tigercosmos
2e3d1d8372 Remove WrappedHttpResponse abstraction 2017-11-26 00:25:44 +08:00
bors-servo
00b3612fe9 Auto merge of #19274 - Manishearth:xhr-cancel, r=jdm
Fetch cancellation

This PR implements cancellation for fetch, and uses it for XHR. This means that fetch clients can now send a message to the fetch task asking for the network request to be aborted.

Previously, clients like XHR had abort functionality but would implement it by simply ignoring future messages from the network task; and would not actually cancel the network fetch.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19274)
<!-- Reviewable:end -->
2017-11-20 20:48:17 -06:00
Manish Goregaokar
6f59b152f1 Add aborted flag to response, set when fetch is aborted 2017-11-20 17:04:55 -08:00
Manish Goregaokar
7249fd6bd8 Fetch cancellation: Listen for cancellation and prematurely abort if cancelled 2017-11-20 16:54:25 -08:00
bors-servo
e2bc0f017c Auto merge of #18676 - gterzian:continue_http_cache_work, r=jdm
Continue http cache work

<!-- Please describe your changes on the following line: -->

Work in progress, and not quite worth a review yet. (Continuation of https://github.com/servo/servo/pull/4117)

TODO

- [ ] cache metadata (find some subset of`net_traits::Metadata` that can be shared across threads, it seems the problem is mainly stuff inside `hyper::header` in the `headers` field)

- [ ] determine which other fields of a `Response` need to be cached, so a full and valid one can be returned upon a cache hit.

- [ ] determine how to best share the cache across fetch threads (inside HttpState like I tried now?)

- [ ] Spend more time reading the spec and make sure the cache follows it where it matters.

- [ ] Make the current wpt tests pass.

- [ ] More...

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #12972  (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18676)
<!-- Reviewable:end -->
2017-11-20 18:22:06 -06:00
Gregory Terzian
2799b4eac9 more http cache work 2017-11-16 13:36:12 +08:00
bors-servo
c9884604e9 Auto merge of #18882 - KiChjang:fix-origin, r=jdm
Use the correct origin in fetch

Fixes #18147.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18882)
<!-- Reviewable:end -->
2017-11-15 16:08:49 -06:00
Keith Yeung
d5e7137b52 Use the correct origin in fetch 2017-11-15 13:17:16 -08:00
Simon Sapin
793bebfc0e Upgrade to rustc 1.23.0-nightly (02004ef78 2017-11-08) 2017-11-09 16:56:39 +01:00
bors-servo
dcd7d2fa32 Auto merge of #18981 - KiChjang:fold-type-destination, r=avadacatavra
Merge request type and destination

Fixes #18278.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18981)
<!-- Reviewable:end -->
2017-10-24 17:02:18 -05:00
Keith Yeung
c6bb1cb9d5 Merge request type and destination 2017-10-23 11:19:35 -07:00
Matt Brubeck
2d45e9d2da Use try syntax for Option where appropriate 2017-10-20 08:25:35 -07:00
Matt Brubeck
efc3683cc7 Fix commonmark Markdown warnings in docs, part 1
Fixes warnings from rust-lang/rust#44229 when `--enable-commonmark` is
passed to rustdoc.

This is mostly a global find-and-replace for bare URIs on lines by
themselves in doc comments.
2017-10-17 11:24:57 -07:00
Keith Yeung
4a4caa8583 Update CORS preflight fetch 2017-08-18 16:30:22 -07:00
Keith Yeung
34178bdd4c Update HTTP-network fetch 2017-08-18 16:30:19 -07:00
Keith Yeung
99f59352b8 Update HTTP-network-or-cache fetch 2017-08-18 16:30:16 -07:00
Keith Yeung
d6c197b40c Update HTTP-redirect fetch 2017-08-18 16:30:06 -07:00
Keith Yeung
0ff47c4475 Update HTTP fetch 2017-08-08 09:27:19 -07:00
Keith Yeung
ed9c16575c Update main fetch 2017-08-08 09:22:29 -07:00
Fausto Núñez Alberro
6032940fb8 Change RequestInit origin type to ImmutableOrigin 2017-07-16 21:44:33 +02:00
Keith Yeung
6adc653083 Introduce service-worker mode 2017-06-22 23:48:07 -07:00
Simon Sapin
316cd35767 Untry 2017-06-18 13:21:51 +02:00
Josh Matthews
fe74460bae Read 32kb from the network at a time. 2017-06-05 13:47:39 -04:00
Nikhil Shagrithaya
541baafe1c Redirect document loads manually 2017-05-31 17:28:53 +05:30
Josh Matthews
525e9c08c8 Show HTTP response headers in debug output. 2017-04-17 11:47:08 +10:00
Anthony Ramine
9394469ede Kill Request::omit_origin_header 2017-04-07 12:52:50 +02:00
Anthony Ramine
16863017a9 Move the HTTP connector in HttpState 2017-04-06 19:35:11 +02:00
Anthony Ramine
12ddc891c6 Pass a &Pool<Connector> to http_loader::obtain_response 2017-04-06 18:50:45 +02:00
Anthony Ramine
949a0827e0 Move the SSL client in HttpState 2017-04-06 18:11:20 +02:00
Josh Matthews
ba132e0b4c Remove unnecessary NetworkHttpRequestFactory abstraction. 2017-04-06 19:25:39 +09:00
Josh Matthews
e9fdc4c72a Replace hosts when making TCP connections, not when verifying SSL certs. 2017-04-06 19:25:37 +09:00
Josh Matthews
6079dd4de7 Enable HTTP connection pooling. Retry stale connections indicated by connection reset errors. 2017-04-04 19:40:46 -04:00
Anthony Ramine
901877da1a Introduce http_loader::set_default_accept 2017-04-04 13:17:18 +02:00
Anthony Ramine
64ba597a3a Move Arc out of HttpState 2017-04-03 14:00:36 +02:00
Anthony Ramine
8683f4d43e Reuse HttpState in ResourceGroup 2017-04-03 12:47:35 +02:00
Anthony Ramine
016fee016b Move the HTTP connector to FetchContext 2017-04-03 12:47:33 +02:00
Anthony Ramine
7b16021a89 Make Response::url_list be a bare Vec<ServoUrl> 2017-04-03 12:47:28 +02:00
Anthony Ramine
80e02303d3 Make Response::internal_response a bare boolean 2017-04-03 12:39:11 +02:00
Anthony Ramine
cb2eb81208 Remove all internal mutability from Request 2017-04-03 12:39:07 +02:00
Anthony Ramine
f42a63baea Make fetch take a &Request 2017-04-03 12:33:43 +02:00
Anthony Ramine
9601a66b60 Make cors_preflight_fetch take a &Request 2017-04-03 11:09:39 +02:00
Anthony Ramine
d5cbdffe37 Make cors_check take a &Request 2017-04-03 11:09:38 +02:00
Anthony Ramine
20e0b6cd56 Introduce create_ssl_client
This lets us reuse the same SSL context for all HTTPS requests.
2017-04-02 15:27:40 +02:00
ddh
e527c9a991 Update Hyper and OpenSSL 2017-03-31 16:32:21 +02:00
Anthony Ramine
f66cae3f96 Revert "Introduce create_ssl_context"
This reverts commit 7a4632bfa2.
2017-03-31 16:19:00 +02:00
bors-servo
0f9dbcc808 Auto merge of #16156 - ferjm:issue-16130-http-network-or-cache-fetch, r=jdm
Update http_network_or_cache_fetch according to spec

There are still many steps blocked by the absence of an HTTP cache and the inability to trigger a credentials dialog.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #16130

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16156)
<!-- Reviewable:end -->
2017-03-29 19:38:45 -05:00
Anthony Ramine
d022535f9c Make the WebSocket handshake ourselves to ease switching libs
We need to switch to tungstenite to finally update openssl, this commit
rewrites the whole websocket infrastructure to properly follow the Fetch
spec and to make switching to a different websocket library easier.
2017-03-29 19:17:27 +02:00
Anthony Ramine
3ed32f8078 Introduce NetworkError::from_hyper_error and from_ssl_error 2017-03-29 18:01:01 +02:00
Anthony Ramine
7a4632bfa2 Introduce create_ssl_context 2017-03-28 00:37:25 +02:00
Fernando Jiménez Moreno
d919f55884 Update http_network_or_cache_fetch according to spec 2017-03-27 19:45:05 +02:00