daemon: Trim cookie string
If the cookie file had a newline in it, the program would not work
This commit is contained in:
@ -18,7 +18,7 @@ use tokio::task::{spawn, JoinHandle};
|
|||||||
pub fn run(opt: DaemonOpt) -> Result<(), Error> {
|
pub fn run(opt: DaemonOpt) -> Result<(), Error> {
|
||||||
let opt: &'static DaemonOpt = Box::leak(Box::new(opt));
|
let opt: &'static DaemonOpt = Box::leak(Box::new(opt));
|
||||||
let cookie: &'static str =
|
let cookie: &'static str =
|
||||||
Box::leak(std::fs::read_to_string(&opt.cookie_file)?.into_boxed_str());
|
Box::leak(std::fs::read_to_string(&opt.cookie_file)?.into_boxed_str()).trim();
|
||||||
|
|
||||||
let rt = Runtime::new()?;
|
let rt = Runtime::new()?;
|
||||||
rt.block_on(async {
|
rt.block_on(async {
|
||||||
|
|||||||
Reference in New Issue
Block a user