diff --git a/Cargo.lock b/Cargo.lock index 2fcf8b8..983d465 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,16 +19,14 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "bindgen" -version = "0.69.4" +version = "0.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" dependencies = [ "bitflags", "cexpr", "clang-sys", "itertools", - "lazy_static", - "lazycell", "log", "prettyplease", "proc-macro2", @@ -37,7 +35,6 @@ dependencies = [ "rustc-hash", "shlex", "syn 2.0.57", - "which", ] [[package]] @@ -213,18 +210,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "libc" version = "0.2.140" @@ -308,9 +293,9 @@ checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "pkg-config" -version = "0.3.26" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "prettyplease" @@ -450,22 +435,19 @@ checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "varnish" version = "0.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98deff452d19846a43892821647e81e5520291d8d006464c31d8e280e1fda139" dependencies = [ + "glob", "pkg-config", - "serde", "varnish-sys", ] [[package]] name = "varnish-sys" version = "0.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f21a779a3c486b0cf616b5980c7a561f11575bc267db5144263593cf8906c646" dependencies = [ "bindgen", "pkg-config", + "serde", ] [[package]] @@ -474,6 +456,7 @@ version = "0.0.6" dependencies = [ "chrono", "varnish", + "varnish-sys", ] [[package]] @@ -536,17 +519,6 @@ version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" -[[package]] -name = "which" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" -dependencies = [ - "either", - "libc", - "once_cell", -] - [[package]] name = "winapi" version = "0.3.9" diff --git a/Cargo.toml b/Cargo.toml index f14b4cd..f029d50 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,10 +5,12 @@ edition = "2021" license = "BSD-3-Clause" [build-dependencies] -varnish = "0.0.19" +#varnish = "0.0.19" +varnish = { path = "../varnish-rs/varnish" } [dependencies] -varnish = "0.0.19" +varnish = { path = "../varnish-rs/varnish" } +varnish-sys = { path = "../varnish-rs/varnish-sys" } chrono = "0.4.23" [lib] diff --git a/src/lib.rs b/src/lib.rs index 3f6e5c5..6de47d9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,17 +11,12 @@ use std::os::unix::fs::MetadataExt; use chrono::DateTime; use chrono::offset::Utc; -use varnish::vcl::ctx::Ctx; -use varnish::vcl::backend::{Backend, Serve, Transfer, VCLBackendPtr}; +use varnish::vcl::Ctx; +use varnish::vcl::{Backend, Serve, Transfer, VCLBackendPtr}; -varnish::vtc!(test01); -varnish::vtc!(test02); -varnish::vtc!(test03); -varnish::vtc!(test04); -varnish::vtc!(test05); -varnish::vtc!(test06); +varnish::run_vtc_tests!("tests/*.vtc"); -// root is the Rust implement of the VCC definition (in vmod.vcc) +// root is the Rust implementation of the VCC definition (in vmod.vcc) // it only contains backend, which wraps a FileBackend, and // handles response body creation with a FileTransfer #[allow(non_camel_case_types)] @@ -88,7 +83,7 @@ impl Serve for FileBackend<> { // combine root and url into something that's hopefully safe let path = assemble_file_path(&self.path, bereq_url); - ctx.log(varnish::vcl::ctx::LogTag::Debug, &format!("fileserver: file on disk: {:?}", path)); + ctx.log(varnish::vcl::LogTag::Debug, &format!("fileserver: file on disk: {:?}", path)); // reset the bereq lifetime, otherwise we couldn't use ctx in the line above // yes, it feels weird at first, but it's for our own good