aboutsummaryrefslogtreecommitdiff
path: root/src/rust
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-10-30 09:33:58 -0400
committerNick Mathewson <nickm@torproject.org>2018-10-30 09:33:58 -0400
commit22338d63c4e579801788727ca3e09fc15f931622 (patch)
tree0c718c3170b07473440c66ba342f12617c083f43 /src/rust
parentde55df0260a25ed26119174555a17c4b29657a90 (diff)
parent7bf9c93ab3af5be6f0881d4bc21fd8d72becff96 (diff)
downloadtor-22338d63c4e579801788727ca3e09fc15f931622.tar.gz
tor-22338d63c4e579801788727ca3e09fc15f931622.zip
Merge remote-tracking branch 'tor-github/pr/431' into bug27740_035_fix
Diffstat (limited to 'src/rust')
-rw-r--r--src/rust/protover/ffi.rs19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/rust/protover/ffi.rs b/src/rust/protover/ffi.rs
index 451bf4665d..5c29adf045 100644
--- a/src/rust/protover/ffi.rs
+++ b/src/rust/protover/ffi.rs
@@ -181,11 +181,7 @@ pub extern "C" fn protover_get_supported_protocols() -> *const c_char {
//
// Why is the threshold a signed integer? —isis
#[no_mangle]
-pub extern "C" fn protover_compute_vote(
- list: *const Stringlist,
- threshold: c_int,
- allow_long_proto_names: bool,
-) -> *mut c_char {
+pub extern "C" fn protover_compute_vote(list: *const Stringlist, threshold: c_int) -> *mut c_char {
if list.is_null() {
return allocate_and_copy_string("");
}
@@ -197,16 +193,9 @@ pub extern "C" fn protover_compute_vote(
let mut proto_entries: Vec<UnvalidatedProtoEntry> = Vec::new();
for datum in data {
- let entry: UnvalidatedProtoEntry = if allow_long_proto_names {
- match UnvalidatedProtoEntry::from_str_any_len(datum.as_str()) {
- Ok(n) => n,
- Err(_) => continue,
- }
- } else {
- match datum.parse() {
- Ok(n) => n,
- Err(_) => continue,
- }
+ let entry: UnvalidatedProtoEntry = match datum.parse() {
+ Ok(n) => n,
+ Err(_) => continue,
};
proto_entries.push(entry);
}