Skip to content

Commit

Permalink
fix(client): fix the incorrect error passing in client side data tran…
Browse files Browse the repository at this point in the history
…smission
  • Loading branch information
genshen committed Jul 31, 2023
1 parent 8a095c0 commit cf056fb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions wss/wssocks_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ func (client *Client) transData(wsc *WebSocketClient, conn *net.TCPConn, firstSe
// tell server to establish connection
if err := proxy.Establish(wsc, firstSendData, proxyType, addr); err != nil {
wsc.RemoveProxy(proxy.Id)
if err := wsc.TellClose(proxy.Id); err != nil {
err := wsc.TellClose(proxy.Id)
if err != nil {
log.Error("close error", err)
}
return err
Expand All @@ -161,7 +162,7 @@ func (client *Client) transData(wsc *WebSocketClient, conn *net.TCPConn, firstSe
if err != nil {
log.Error("write error: ", err)
}
done <- Done{true, nil}
done <- Done{true, err}
}()
defer writer.CloseWsWriter(cancel) // cancel data writing

Expand Down

0 comments on commit cf056fb

Please sign in to comment.