banners: tell why one is missing, accept more, bigger defaults
Failures are in the log with the host and the reason, never the whole address: HTTP status, the whole chain of causes (TLS, DNS, timeouts), what came instead of a picture (an HTML page, AVIF); banner addresses that cannot be fetched at all once; avatars and icons in the server's files when they give up (a closed file transfer port shows here). More is shown: BMP and ICO, SVG after a comment or a DOCTYPE, addresses with blanks around them; pictures larger than 4096 px are scaled down instead of refused (only above 512 MiB of pixels). Banners keep being tried while shown (after 1, 4, 16, 60, 300, 900 s, then every 15 min). Defaults: connect 20 s, read 60 s, slow start 120 s, 16 downloads at once, 20 redirects, pictures up to 128 MiB at 8 KiB/s at least, file transfer negotiation 30 s and a minute plus size, cache.max_mb 1024, ui.image_cache_mb 256. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VZBWxxMsxUzp4PSTKVzbZN
This commit is contained in:
1 parent
259a23a165
commit
db94e21e27
9 files changed
+282
-85
No files matched your search
@@ -46,7 +46,7 @@ fn server_details(server: &data::Server, uid: Option<&str>) -> ServerDetails {
|
||||
tsclientlib::HostMessageMode::Modalquit => HostMessageMode::ModalQuit,
|
||||
},
|
||||
banner_url: server.hostbanner_url.clone(),
|
||||
banner_gfx_url: server.hostbanner_gfx_url.clone(),
|
||||
banner_gfx_url: server.hostbanner_gfx_url.trim().to_owned(),
|
||||
banner_gfx_interval_s: server.hostbanner_gfx_interval.whole_seconds().max(0) as u64,
|
||||
banner_mode: match server.hostbanner_mode {
|
||||
tsclientlib::HostBannerMode::NoAdjust => BannerMode::NoAdjust,
|
||||
@@ -115,7 +115,12 @@ pub(crate) fn presence_from_book(
|
||||
needed_talk_power: c.needed_talk_power.unwrap_or(0),
|
||||
is_default: c.is_default.unwrap_or(false),
|
||||
icon: c.icon.map_or(0, |i| i.0),
|
||||
banner_gfx_url: c.banner_gfx_url.clone().filter(|u| !u.is_empty()),
|
||||
banner_gfx_url: c
|
||||
.banner_gfx_url
|
||||
.as_deref()
|
||||
.map(str::trim)
|
||||
.filter(|u| !u.is_empty())
|
||||
.map(str::to_owned),
|
||||
// A number the book keeps as text.
|
||||
banner_mode: c
|
||||
.banner_mode
|
||||
|
||||
Reference in new issue
Block a user