Skip to content

Commit

Permalink
chore: ignore errors explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
Mythologyli committed Nov 1, 2023
1 parent 396d89f commit c9fbfb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions client/rvpn_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (r *RvpnConn) Read(p []byte) (n int, err error) {
log.Printf("Error occurred while receiving, retrying: %v", err)

// Do handshake again and create a new recvConn
r.recvConn.Close()
_ = r.recvConn.Close()
r.recvConn, err = r.easyConnectClient.RecvConn()
if err != nil {
// TODO graceful shutdown
Expand All @@ -41,7 +41,7 @@ func (r *RvpnConn) Write(p []byte) (n int, err error) {
log.Printf("Error occurred while sending, retrying: %v", err)

// Do handshake again and create a new sendConn
r.sendConn.Close()
_ = r.sendConn.Close()
r.sendConn, err = r.easyConnectClient.SendConn()
if err != nil {
// TODO graceful shutdown
Expand All @@ -57,10 +57,10 @@ func (r *RvpnConn) Write(p []byte) (n int, err error) {

func (r *RvpnConn) Close() error {
if r.sendConn != nil {
r.sendConn.Close()
_ = r.sendConn.Close()
}
if r.recvConn != nil {
r.recvConn.Close()
_ = r.recvConn.Close()
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion stack/tun/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (s *Stack) Run() {
continue
}

s.rvpnConn.Write(buf[:n])
_, _ = s.rvpnConn.Write(buf[:n])

log.DebugPrintf("Send: wrote %d bytes", n)
log.DebugDumpHex(buf[:n])
Expand Down

0 comments on commit c9fbfb1

Please sign in to comment.