X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fcypherpunks.ru%2Fnncp%2Fcmd%2Fnncp-daemon%2Fmain.go;h=67e2c533f410b3b8410bc2bab74b80f160f299e3;hb=dd92823db3d72fb21a4c712a7fb052dce16443dd;hp=8346774093f30a7c03cea0953ebb614e6b0a3c65;hpb=a46ffb69cbf3501ad02386eb9d3dabd1f3ebc90e;p=nncp.git diff --git a/src/cypherpunks.ru/nncp/cmd/nncp-daemon/main.go b/src/cypherpunks.ru/nncp/cmd/nncp-daemon/main.go index 8346774..67e2c53 100644 --- a/src/cypherpunks.ru/nncp/cmd/nncp-daemon/main.go +++ b/src/cypherpunks.ru/nncp/cmd/nncp-daemon/main.go @@ -4,8 +4,7 @@ Copyright (C) 2016-2019 Sergey Matveev This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. +the Free Software Foundation, version 3 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -61,8 +60,11 @@ func (ic *InetdConn) SetWriteDeadline(t time.Time) error { } func performSP(ctx *nncp.Ctx, conn nncp.ConnDeadlined, nice uint8) { - state, err := ctx.StartR(conn, nice, "") - if err == nil { + state := nncp.SPState{ + Ctx: ctx, + Nice: nice, + } + if err := state.StartR(conn); err == nil { ctx.LogI("call-start", nncp.SDS{"node": state.Node.Id}, "connected") state.Wait() ctx.LogI("call-finish", nncp.SDS{ @@ -75,7 +77,7 @@ func performSP(ctx *nncp.Ctx, conn nncp.ConnDeadlined, nice uint8) { }, "") } else { nodeId := "unknown" - if state != nil && state.Node != nil { + if state.Node != nil { nodeId = state.Node.Id.String() } ctx.LogE("call-start", nncp.SDS{"node": nodeId, "err": err}, "")