Refactored database handling
This commit is contained in:
@ -3,8 +3,8 @@ use crate::usimp;
|
||||
use crate::websocket;
|
||||
use chrono;
|
||||
use json;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::borrow::Borrow;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
pub struct HttpStream {
|
||||
pub stream: super::Stream,
|
||||
@ -120,7 +120,7 @@ fn endpoint_handler(
|
||||
"Unable to parse header: Content-Length missing",
|
||||
client,
|
||||
)
|
||||
},
|
||||
}
|
||||
}
|
||||
.parse()
|
||||
{
|
||||
@ -131,7 +131,7 @@ fn endpoint_handler(
|
||||
format!("Unable to parse Content-Length: {}", &e).as_str(),
|
||||
client,
|
||||
)
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
client.stream.read_exact(&mut buf[..length]);
|
||||
@ -145,7 +145,7 @@ fn endpoint_handler(
|
||||
format!("Unable to parse payload: {}", &e).as_str(),
|
||||
client,
|
||||
)
|
||||
},
|
||||
}
|
||||
}) {
|
||||
Ok(val) => val,
|
||||
Err(e) => {
|
||||
@ -154,7 +154,7 @@ fn endpoint_handler(
|
||||
format!("Unable to parse JSON: {}", &e).as_str(),
|
||||
client,
|
||||
)
|
||||
},
|
||||
}
|
||||
};
|
||||
let output = usimp::endpoint(endpoint, input);
|
||||
|
||||
|
Reference in New Issue
Block a user