1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-30 05:56:54 -05:00

check error for the first payload

This commit is contained in:
Darien Raymond 2017-01-06 11:40:49 +01:00
parent 06a73adb1e
commit f2fcc90de2
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -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)