From 66947be1f53eeb6906da6fa13cf4aabcee0d7948 Mon Sep 17 00:00:00 2001 From: Ummon Date: Sat, 8 Nov 2014 17:53:27 +0100 Subject: [PATCH] Update according the new nightly build. --- lab1_rust/Cargo.lock | 6 +++--- lab1_rust/Cargo.toml | 2 +- lab1_rust/src/end_point.rs | 4 ++-- lab1_rust/src/oracle_machine.rs | 2 +- lab1_rust/src/packet.rs | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lab1_rust/Cargo.lock b/lab1_rust/Cargo.lock index dd6deb9..bec944f 100644 --- a/lab1_rust/Cargo.lock +++ b/lab1_rust/Cargo.lock @@ -1,12 +1,12 @@ [root] name = "lab1_rust" -version = "0.0.1" +version = "0.0.2" dependencies = [ - "openssl 0.0.0 (git+https://github.com/sfackler/rust-openssl.git#1e706b8ef4d4344b5297b90bcd430cc96f40fb39)", + "openssl 0.0.0 (git+https://github.com/sfackler/rust-openssl.git#766ce4b7785c0b038bee95b74564e5b9bf7e9a4b)", ] [[package]] name = "openssl" version = "0.0.0" -source = "git+https://github.com/sfackler/rust-openssl.git#1e706b8ef4d4344b5297b90bcd430cc96f40fb39" +source = "git+https://github.com/sfackler/rust-openssl.git#766ce4b7785c0b038bee95b74564e5b9bf7e9a4b" diff --git a/lab1_rust/Cargo.toml b/lab1_rust/Cargo.toml index 3f218e2..a9ce35a 100644 --- a/lab1_rust/Cargo.toml +++ b/lab1_rust/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "lab1_rust" -version = "0.0.1" +version = "0.0.2" authors = ["Ummon "] diff --git a/lab1_rust/src/end_point.rs b/lab1_rust/src/end_point.rs index 128a017..bf8d4de 100644 --- a/lab1_rust/src/end_point.rs +++ b/lab1_rust/src/end_point.rs @@ -23,7 +23,7 @@ pub struct EndPoint { impl Server { pub fn new(interface: &str, port: u16, variant: packet::Variant) -> IoResult { - let mut acceptor = try!(TcpListener::bind(interface, port).listen()); + let mut acceptor = try!(TcpListener::bind((interface, port)).listen()); let server = Server { acceptor: acceptor.clone() @@ -77,7 +77,7 @@ impl Server { impl Client { pub fn new(address: &str, port: u16, variant: packet::Variant) -> IoResult { Ok(Client { end_point: EndPoint { - socket: try!(TcpStream::connect(address, port)), + socket: try!(TcpStream::connect((address, port))), current_timestamp: 0, variant: variant, }}) diff --git a/lab1_rust/src/oracle_machine.rs b/lab1_rust/src/oracle_machine.rs index dd0430d..8bf3933 100644 --- a/lab1_rust/src/oracle_machine.rs +++ b/lab1_rust/src/oracle_machine.rs @@ -10,7 +10,7 @@ use end_point::EndPoint; /// May print some messages on stdout. pub fn decipher(address: &str, port: u16, original_xor_operand: &[u8, ..16], cipher_block: &[u8, ..16], variant: packet::Variant) -> Option> { let mut end_point = EndPoint::new( - match TcpStream::connect(address, port) { + match TcpStream::connect((address, port)) { Ok(s) => s, _ => { println!("Unable to connect to the oracle on [{}]:{}", address, port); diff --git a/lab1_rust/src/packet.rs b/lab1_rust/src/packet.rs index 8b02ccd..fa13191 100644 --- a/lab1_rust/src/packet.rs +++ b/lab1_rust/src/packet.rs @@ -150,7 +150,7 @@ impl Packet { match self.t { Command(_) | Answer(_) => { let padding_size = if data.len() % 16 == 0 { 16 } else { 16 - data.len() % 16 } ; - data.reserve_additional(padding_size); + data.reserve(padding_size); for i in range(0, padding_size) { data.push(padd_fun(i, padding_size)); } -- 2.45.2