Skip to content

Commit

Permalink
Merge pull request #126 from nats-io/tyler_fix_port_signedness
Browse files Browse the repository at this point in the history
Fix port signedness for ServerInfo
  • Loading branch information
spacejam authored Nov 19, 2020
2 parents 6242d68 + ccddc6f commit 51f34b2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 0.8.6

## Bug Fixes

- #126 Fix port signedness issue on ServerInfo which
prevented connecting to servers on ports over i16::MAX.

# 0.8.5

## Improvements
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nats"
version = "0.8.5"
version = "0.8.6"
description = "A Rust NATS client"
authors = ["Derek Collison <[email protected]>", "Tyler Neely <[email protected]>", "Stjepan Glavina <[email protected]>"]
edition = "2018"
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ struct ServerInfo {
/// The host specified in the cluster parameter/options.
pub host: String,
/// The port number specified in the cluster parameter/options.
pub port: i16,
pub port: u16,
/// The version of the NATS server.
pub version: String,
/// If this is set, then the server should try to authenticate upon connect.
Expand Down Expand Up @@ -271,7 +271,7 @@ impl ServerInfo {
server_id: obj["server_id"].take_string()?,
server_name: obj["server_name"].take_string().unwrap_or_default(),
host: obj["host"].take_string()?,
port: obj["port"].as_i16()?,
port: obj["port"].as_u16()?,
version: obj["version"].take_string()?,
auth_required: obj["auth_required"].as_bool().unwrap_or(false),
tls_required: obj["tls_required"].as_bool().unwrap_or(false),
Expand Down

0 comments on commit 51f34b2

Please sign in to comment.