Skip to content

Commit

Permalink
net.tcp: fix peer_ip to only return the ip address
Browse files Browse the repository at this point in the history
  • Loading branch information
Delta456 committed Jul 9, 2024
1 parent ae3b80c commit 5336316
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vlib/net/tcp.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ pub fn (c &TcpConn) peer_addr() !Addr {

// peer_ip retrieves the ip address used by the peer, and returns it as a string
pub fn (c &TcpConn) peer_ip() !string {
return c.peer_addr()!.str()
return c.peer_addr()!.str().all_before(':')
}

pub fn (c &TcpConn) addr() !Addr {
Expand Down

0 comments on commit 5336316

Please # to comment.