renamed cts.id/sid to cts.Id/Sid respectively
This commit is contained in:
@ -31,11 +31,11 @@ func (cpc *ClientPeerConn) RunTask(wg *sync.WaitGroup) error {
|
||||
n, err = cpc.conn.Read(buf[:])
|
||||
if err != nil {
|
||||
if errors.Is(err, io.EOF) || strings.Contains(err.Error(), "use of closed network connection") { // i hate checking this condition with strings.Contains()
|
||||
cpc.route.cts.cli.log.Write(cpc.route.cts.sid, LOG_INFO,
|
||||
cpc.route.cts.cli.log.Write(cpc.route.cts.Sid, LOG_INFO,
|
||||
"Client-side peer(%d,%d,%s,%s) closed",
|
||||
cpc.route.Id, cpc.conn_id, cpc.conn.RemoteAddr().String(), cpc.conn.LocalAddr().String())
|
||||
} else {
|
||||
cpc.route.cts.cli.log.Write(cpc.route.cts.sid, LOG_ERROR,
|
||||
cpc.route.cts.cli.log.Write(cpc.route.cts.Sid, LOG_ERROR,
|
||||
"Failed to read from client-side peer(%d,%d,%s,%s) - %s",
|
||||
cpc.route.Id, cpc.conn_id, cpc.conn.RemoteAddr().String(), cpc.conn.LocalAddr().String(), err.Error())
|
||||
}
|
||||
@ -44,7 +44,7 @@ func (cpc *ClientPeerConn) RunTask(wg *sync.WaitGroup) error {
|
||||
|
||||
err = cpc.route.cts.psc.Send(MakePeerDataPacket(cpc.route.Id, cpc.conn_id, buf[0:n]))
|
||||
if err != nil {
|
||||
cpc.route.cts.cli.log.Write(cpc.route.cts.sid, LOG_ERROR,
|
||||
cpc.route.cts.cli.log.Write(cpc.route.cts.Sid, LOG_ERROR,
|
||||
"Failed to write peer(%d,%d,%s,%s) data to server - %s",
|
||||
cpc.route.Id, cpc.conn_id, cpc.conn.RemoteAddr().String(), cpc.conn.LocalAddr().String(), err.Error())
|
||||
break
|
||||
|
Reference in New Issue
Block a user