aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Audron <audron@cocaine.farm>2020-04-30 12:30:11 +0200
committerMax Audron <audron@cocaine.farm>2020-04-30 12:30:11 +0200
commit002ea77d28dfa18b7726bcae8a5ffed623058deb (patch)
treece812961b97655a8f47725682d0734cee965869d
parentrefactor everything (diff)
cleanup
-rw-r--r--src/client/mod.rs2
-rw-r--r--src/message/login.rs1
-rw-r--r--src/message/mod.rs2
-rw-r--r--src/util.rs2
4 files changed, 3 insertions, 4 deletions
diff --git a/src/client/mod.rs b/src/client/mod.rs
index 5c9699e..b43115b 100644
--- a/src/client/mod.rs
+++ b/src/client/mod.rs
@@ -137,7 +137,7 @@ pub async fn handle_login_message<T: AsyncRead + AsyncWrite + Unpin>(client: &mu
"ClientInitAck" => {
info!(target: "init", "Initialization successfull");
info!(target: "login", "Starting Login");
- let login = ClientLogin {user: "audron".to_string(), password: "***REMOVED***".to_string()};
+ let login = ClientLogin {user: "audron".to_string(), password: "audron".to_string()};
client.stream.send(login.serialize()?).await?;
},
"ClientInitReject" => {
diff --git a/src/message/login.rs b/src/message/login.rs
deleted file mode 100644
index 8b13789..0000000
--- a/src/message/login.rs
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/src/message/mod.rs b/src/message/mod.rs
index b390e2f..16f2088 100644
--- a/src/message/mod.rs
+++ b/src/message/mod.rs
@@ -1,5 +1,3 @@
mod handshake;
-mod login;
pub use handshake::*;
-pub use login::*;
diff --git a/src/util.rs b/src/util.rs
index dd87f7f..192e270 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -19,6 +19,7 @@ macro_rules! match_variant {
};
}
+/// Prepend the length of `buf` to `buf`
pub fn prepend_byte_len(buf: &mut Vec<u8>) {
use std::convert::TryInto;
let len: i32 = buf.len().try_into().unwrap();
@@ -29,6 +30,7 @@ pub fn prepend_byte_len(buf: &mut Vec<u8>) {
buf.insert(0, ulen[0]);
}
+/// Insert a bytes `input` into `buf` at position `pos`
pub fn insert_bytes(pos: usize, buf: &mut Vec<u8>, input: &mut [u8]) {
input.reverse();
for i in input {
td>-8/+79 2025-02-26refactor variant deserializationMax Audron-123/+59 2025-02-26refactor deserialize and serializevariant traitMax Audron-90/+80 2025-02-26refactor variant serialization codeMax Audron-256/+405 2025-02-26add MsgId and BufferId to objects where neededMax Audron-141/+157 2025-02-25enable transparent repr for msgid and bufferidMax Audron-0/+2 2025-02-25Implement BacklogManagerTobias Deiminger-59/+113 2025-02-25Use BufferId in BufferInfoTobias Deiminger-10/+11 2025-02-25Use BufferId in VariantTobias Deiminger-2/+33 2025-02-25Add BufferId as Rust typeTobias Deiminger-0/+39 2025-02-25Use MsgId in MessageTobias Deiminger-18/+6 2025-02-25Use MsgId in VariantTobias Deiminger-20/+37 2025-02-25Add MsgId as Rust typeTobias Deiminger-0/+56 2025-02-24added session manager comments and log messageMax Audron-1/+3 2025-02-23add identity syncable to SessionManagerMax Audron-1/+8 2025-02-23add syncables for IrcUserMax Audron-2/+53 2025-02-23move network config to it's own file and impl it's syncMax Audron-23/+84 2025-02-23add basic network syncablesMax Audron-39/+420 2025-02-23clean up unused_import and unused_variables a bitMax Audron-2/+8 2025-02-23fix server feature errorsMax Audron-28/+23 2025-02-23fix ircchannel and maplist network representationMax Audron-154/+137 2025-02-22replace deprecated failure crate with thiserrorMax Audron-278/+194 2025-02-22update dependencies and fix errorsMax Audron-508/+332 2025-02-22update flakeMax Audron-94/+117 2024-05-22add todos to readmeMax Audron-16/+35