Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
ci:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v2
Expand All @@ -32,10 +32,10 @@ jobs:
run: cargo doc

nix:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/cache@v4
with:
path: /nix
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:
jobs:

release:
# Should match the version that Polygott uses.
runs-on: ubuntu-18.04
# Should match the version reported by /etc/lsb-release on Repls.
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v2
Expand Down
5 changes: 4 additions & 1 deletion src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,8 @@ fn validate_token(token: &str, replid: &str, pubkeys: &HashMap<String, Vec<u8>>)
Some(crate::api::repl_token::Metadata::Id(id)) => id.id.clone(),
_ => bail!("token does not contain a replid: {:?}", &repl_token),
};
if token_replid != replid {
let pruned_replid = replid.split_once(":").map(|(replid, _)| replid.to_string());
if token_replid != replid && Some(&token_replid) != pruned_replid.as_ref() {
bail!(
"token not issued for replid {:?}: {:?}",
&token_replid,
Expand Down Expand Up @@ -1056,6 +1057,8 @@ mod tests {
.expect("Failed to generate PASETO");

validate_token(&token, &replid.to_string(), &pubkeys).expect("Failed to validate token");
validate_token(&token, &format!("{replid}:01").to_string(), &pubkeys)
.expect("Failed to validate token");
validate_token(
&String::from("this is not a token"),
&replid.to_string(),
Expand Down
4 changes: 2 additions & 2 deletions src/messages/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl Message {
skip(src, 3 * number_of_colors)?;

let bpp = if number_of_colors <= 2 { 1 } else { 8 };
let row_size = (width * bpp + 7) / 8;
let row_size = (width * bpp).div_ceil(8);
let uncompressed_size = row_size * height;

log::debug!(
Expand Down Expand Up @@ -150,7 +150,7 @@ impl Message {
// Cursor Pseudo-encoding
-239 => {
skip(src, width * height * bytes_per_pixel)?;
let row_size = (width + 7) / 8;
let row_size = width.div_ceil(8);
skip(src, row_size * height)
}
// QEMU Extended Key Event Pseudo-encoding
Expand Down
2 changes: 1 addition & 1 deletion src/rfb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl RfbConnection {
})
}

pub fn split(&mut self) -> (ReadHalf, WriteHalf) {
pub fn split<'a>(&'a mut self) -> (ReadHalf<'a>, WriteHalf<'a>) {
let (rs, ws) = self.stream.split();
(
ReadHalf {
Expand Down
Loading