mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 09:54:01 +03:00
Use SyncWrite call to send a packet to proxy
This commit is contained in:
@@ -247,7 +247,7 @@ func (suite *ConnTestSuite) TestSyncWriteBlocksAsyncWrite() {
|
||||
|
||||
go func() {
|
||||
defer close(syncDone)
|
||||
c.SyncWrite([]byte("exclusive"))
|
||||
c.SyncWrite([]byte("exclusive")) //nolint: errcheck
|
||||
}()
|
||||
|
||||
// Give SyncWrite time to acquire the lock.
|
||||
@@ -258,7 +258,7 @@ func (suite *ConnTestSuite) TestSyncWriteBlocksAsyncWrite() {
|
||||
|
||||
go func() {
|
||||
defer close(writeDone)
|
||||
c.Write([]byte("blocked"))
|
||||
c.Write([]byte("blocked")) //nolint: errcheck
|
||||
}()
|
||||
|
||||
// SyncWrite should finish first.
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ func (p *Proxy) ServeConn(conn essentials.Conn) {
|
||||
}
|
||||
defer clientConn.Stop()
|
||||
|
||||
if _, err := clientConn.Write(noise); err != nil {
|
||||
if _, err := clientConn.SyncWrite(noise); err != nil {
|
||||
ctx.logger.InfoError("cannot send the first packet", err)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user