Compare commits

...

4 Commits

Author SHA1 Message Date
Trisha 33f2891773 increase max port count to 15 2021-10-19 11:19:50 -05:00
Trisha 3a8fdbe6cd ♻️ refactor: extract MAX_PORTS 2021-10-19 11:19:01 -05:00
Trisha 8189bc9769 ⬆️ fltk 1.2.8 2021-10-19 11:17:53 -05:00
Trisha 3c328eb58f 🔊 improve error message 2021-10-19 11:11:12 -05:00
3 changed files with 10 additions and 8 deletions

8
Cargo.lock generated
View File

@ -345,9 +345,9 @@ checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
[[package]] [[package]]
name = "fltk" name = "fltk"
version = "1.2.7" version = "1.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0953c34fd5b0c6ac1b615fdcda8845c81ed364165b115ddac46ae8953d456640" checksum = "889d9b2176b88c6f8f90ba64b0b030e52807ed1d6e416df0c15611225b40cc1d"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"fltk-sys", "fltk-sys",
@ -356,9 +356,9 @@ dependencies = [
[[package]] [[package]]
name = "fltk-sys" name = "fltk-sys"
version = "1.2.7" version = "1.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2df700440c014123cc1644fbef7d33dcdda18cdd80373a7552a9d5cec47ca63" checksum = "e38b2f3fb23b4bd46fc492d5d8d099b0bf766a7ab5d18b8424d93089ae934a48"
dependencies = [ dependencies = [
"cmake", "cmake",
] ]

View File

@ -10,7 +10,7 @@ license = "AGPL-3.0"
[dependencies] [dependencies]
anyhow = "1.0.38" anyhow = "1.0.38"
blake3 = "1.0.0" blake3 = "1.0.0"
fltk = "1.2.7" fltk = "1.2.8"
quic_demo = { path = "../quic_demo" } quic_demo = { path = "../quic_demo" }
quinn = "0.7.2" quinn = "0.7.2"
rand = "0.8.4" rand = "0.8.4"

View File

@ -136,7 +136,9 @@ impl GuiClient <'_> {
ports_col: &mut Flex, ports_col: &mut Flex,
fltk_tx: fltk::app::Sender <Message> fltk_tx: fltk::app::Sender <Message>
) { ) {
if self.ports.len () >= 5 { const MAX_PORTS: usize = 15;
if self.ports.len () >= MAX_PORTS {
return; return;
} }
@ -151,7 +153,7 @@ impl GuiClient <'_> {
self.ports.push (port); self.ports.push (port);
if self.ports.len () >= 5 { if self.ports.len () >= MAX_PORTS {
self.but_add_port.deactivate (); self.but_add_port.deactivate ();
} }
} }
@ -224,7 +226,7 @@ fn main () -> anyhow::Result <()> {
let connection_p2_p3 = rt.block_on (async move { let connection_p2_p3 = rt.block_on (async move {
let server_cert = match opt.cert_url.as_ref () { let server_cert = match opt.cert_url.as_ref () {
Some (url) => reqwest::get (url).await?.bytes ().await?, Some (url) => reqwest::get (url).await?.bytes ().await?,
None => tokio::fs::read ("ptth_quic_output/quic_server.crt").await?.into (), None => tokio::fs::read ("ptth_quic_output/quic_server.crt").await.context ("can't read quic_server.crt from disk")?.into (),
}; };
let endpoint = make_client_endpoint ("0.0.0.0:0".parse ()?, &[&server_cert])?; let endpoint = make_client_endpoint ("0.0.0.0:0".parse ()?, &[&server_cert])?;