mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Propagating the load errors from network loader
This commit is contained in:
parent
8d988f20c1
commit
5e6f32a59b
15 changed files with 208 additions and 152 deletions
|
@ -18,7 +18,7 @@ use hyper::header::{HeaderView, Headers};
|
|||
use hyper::method::Method;
|
||||
use hyper::mime::{Mime, SubLevel, TopLevel};
|
||||
use hyper::status::StatusClass::Success;
|
||||
use net_traits::{AsyncResponseListener, Metadata, ResponseAction};
|
||||
use net_traits::{AsyncResponseListener, Metadata, NetworkError, ResponseAction};
|
||||
use network_listener::{NetworkListener, PreInvoke};
|
||||
use script_runtime::ScriptChan;
|
||||
use std::ascii::AsciiExt;
|
||||
|
@ -124,13 +124,15 @@ impl CORSRequest {
|
|||
// This is shoe-horning the CORSReponse stuff into the rest of the async network
|
||||
// framework right now. It would be worth redesigning http_fetch to do this properly.
|
||||
impl AsyncResponseListener for CORSContext {
|
||||
fn headers_available(&mut self, _metadata: Metadata) {
|
||||
fn headers_available(&mut self, _metadata: Result<Metadata, NetworkError>) {
|
||||
|
||||
}
|
||||
|
||||
fn data_available(&mut self, _payload: Vec<u8>) {
|
||||
|
||||
}
|
||||
|
||||
fn response_complete(&mut self, _status: Result<(), String>) {
|
||||
fn response_complete(&mut self, _status: Result<(), NetworkError>) {
|
||||
let response = self.response.take().unwrap();
|
||||
self.listener.response_available(response);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue