Skip to content

Commit

Permalink
fix: windows
Browse files Browse the repository at this point in the history
  • Loading branch information
pxseu committed Dec 9, 2022
1 parent 7bbaa15 commit fcfe711
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/commands/tunnel/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub enum TonneruPacket {
port: u16,
},
Connect {
container_id: String,
resource_id: String,
},
}

Expand Down Expand Up @@ -56,7 +56,7 @@ impl<'de> Deserialize<'de> for TonneruPacket {
.ok_or_else(|| serde::de::Error::custom("container_id is not a string"))?;

Ok(TonneruPacket::Connect {
container_id: container_id.to_string(),
resource_id: container_id.to_string(),
})
}
_ => Err(SerdeDeError::custom("invalid opcode received")),
Expand Down
4 changes: 2 additions & 2 deletions src/commands/tunnel/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl TonneruSocket {

let packet = serde_json::to_vec(&TonneruPacket::Auth {
token: self.token.clone(),
resource_id: self.deployment_id.clone(),
resource_id: self.resource_id.clone(),
port: self.port,
})?;

Expand All @@ -141,7 +141,7 @@ impl TonneruSocket {

match socket.read(&mut buf).await {
Ok(n) => match serde_json::from_slice::<TonneruPacket>(&buf[..n]) {
Ok(TonneruPacket::Connect) => Ok(socket),
Ok(TonneruPacket::Connect { .. }) => Ok(socket),
_ => Err(anyhow!(
"Unexpected packet. Received: {}",
String::from_utf8_lossy(&buf[..n])
Expand Down

0 comments on commit fcfe711

Please sign in to comment.