mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Deindent some of the code in http_network_fetch.
This commit is contained in:
parent
f5a3d68513
commit
40c6b21fd7
1 changed files with 81 additions and 81 deletions
|
@ -1018,8 +1018,19 @@ fn http_network_fetch<UI: 'static + UIProvider>(request: Rc<Request>,
|
|||
|
||||
let pipeline_id = request.pipeline_id.get();
|
||||
let mut response = Response::new();
|
||||
match wrapped_response {
|
||||
Ok((res, msg)) => {
|
||||
let (res, msg) = match wrapped_response {
|
||||
Ok(wrapped_response) => wrapped_response,
|
||||
Err(error) => {
|
||||
let error = match error.error {
|
||||
LoadErrorType::ConnectionAborted { .. } => unreachable!(),
|
||||
LoadErrorType::Ssl { reason } => NetworkError::SslValidation(error.url, reason),
|
||||
LoadErrorType::Cancelled => NetworkError::LoadCancelled,
|
||||
e => NetworkError::Internal(e.description().to_owned())
|
||||
};
|
||||
return Response::network_error(error);
|
||||
}
|
||||
};
|
||||
|
||||
response.url = Some(url.clone());
|
||||
response.status = Some(res.response.status);
|
||||
response.raw_status = Some((res.response.status_raw().0,
|
||||
|
@ -1098,17 +1109,6 @@ fn http_network_fetch<UI: 'static + UIProvider>(request: Rc<Request>,
|
|||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
Err(error) => {
|
||||
let error = match error.error {
|
||||
LoadErrorType::ConnectionAborted { .. } => unreachable!(),
|
||||
LoadErrorType::Ssl { reason } => NetworkError::SslValidation(error.url, reason),
|
||||
LoadErrorType::Cancelled => NetworkError::LoadCancelled,
|
||||
e => NetworkError::Internal(e.description().to_owned())
|
||||
};
|
||||
return Response::network_error(error);
|
||||
}
|
||||
};
|
||||
|
||||
// TODO these substeps aren't possible yet
|
||||
// Substep 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue