Skip to content

Commit

Permalink
check error for the first payload
Browse files Browse the repository at this point in the history
  • Loading branch information
DarienRaymond committed Jan 6, 2017
1 parent 06a73ad commit f2fcc90
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions proxy/shadowsocks/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,14 @@ func (v *Server) handleConnection(conn internet.Connection) {
if err != nil {
return err
}
responseWriter.Write(payload)
bufferedWriter.SetBuffered(false)
if err := responseWriter.Write(payload); err != nil {
return err
}
payload.Release()

if err := bufferedWriter.SetBuffered(false); err != nil {
return err
}

if err := buf.PipeUntilEOF(ray.InboundOutput(), responseWriter); err != nil {
log.Info("Shadowsocks|Server: Failed to transport all TCP response: ", err)
Expand Down

0 comments on commit f2fcc90

Please sign in to comment.