Skip to content

Commit

Permalink
Remove Preferences::network_tls_ignore_unexpected_eof (servo#35080)
Browse files Browse the repository at this point in the history
This workaround was introduced to handle an issue with the WPT server,
but it seems that it is no longer needed. This change removes the
prefernce and the workarond code.

Signed-off-by: Martin Robinson <[email protected]>
  • Loading branch information
mrobinson authored Jan 20, 2025
1 parent 9ceb957 commit 2965b2f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
7 changes: 0 additions & 7 deletions components/config/prefs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,6 @@ pub struct Preferences {
pub network_http_cache_disabled: bool,
pub network_local_directory_listing_enabled: bool,
pub network_mime_sniff: bool,
/// Ignore `std::io::Error` with `ErrorKind::UnexpectedEof` received when a TLS connection
/// is closed without a close_notify.
///
/// Used for tests because WPT server doesn't properly close the TLS connection.
// TODO: remove this when WPT server is updated to use a proper TLS implementation.
pub network_tls_ignore_unexpected_eof: bool,
pub session_history_max_length: i64,
/// The background color of shell's viewport. This will be used by OpenGL's `glClearColor`.
pub shell_background_color_rgba: [f64; 4],
Expand Down Expand Up @@ -378,7 +372,6 @@ impl Preferences {
network_http_cache_disabled: false,
network_local_directory_listing_enabled: false,
network_mime_sniff: false,
network_tls_ignore_unexpected_eof: false,
session_history_max_length: 20,
shell_background_color_rgba: [1.0, 1.0, 1.0, 1.0],
threadpools_async_runtime_workers_max: 6,
Expand Down
5 changes: 1 addition & 4 deletions components/net/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ use http_body_util::BodyExt;
use hyper::body::Body;
use hyper::header::{HeaderValue, CONTENT_ENCODING, TRANSFER_ENCODING};
use hyper::Response;
use servo_config::pref;
use tokio_util::codec::{BytesCodec, FramedRead};
use tokio_util::io::StreamReader;

Expand Down Expand Up @@ -279,9 +278,7 @@ impl Stream for BodyStream {
let all_content_read = self
.content_length
.map_or(false, |c| c.0 == self.total_read);
if self.is_secure_scheme &&
(all_content_read || pref!(network_tls_ignore_unexpected_eof))
{
if self.is_secure_scheme && all_content_read {
let source = err.source();
let is_unexpected_eof = source
.and_then(|e| e.downcast_ref::<io::Error>())
Expand Down
3 changes: 1 addition & 2 deletions resources/wpt-prefs.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"dom_webxr_test": true,
"gfx_text_antialiasing_enabled": false,
"network_tls_ignore_unexpected_eof": true
"gfx_text_antialiasing_enabled": false
}

0 comments on commit 2965b2f

Please sign in to comment.