Skip to content

Commit

Permalink
merge(client): Merge pull request #68 from genshen/fix-error-passing-…
Browse files Browse the repository at this point in the history
…in-client

fix(client): fix the incorrect error passing in client side data transmission (in `Client.transData` of file `wss/wssocks_client.go`)
  • Loading branch information
genshen committed Jul 31, 2023
2 parents 8a095c0 + cf056fb commit ad3afab
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 ad3afab

Please sign in to comment.