Commit c3dbd4f1 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 745961cc
......@@ -185,7 +185,7 @@ func (stor *Storage) m1initialize1(ctx context.Context, req neonet.Request) erro
lastTid, zerr1 := stor.back.LastTid(ctx)
lastOid, zerr2 := stor.back.LastOid(ctx)
if zerr := xerr.First(zerr1, zerr2); zerr != nil {
return zerr // XXX send the error to M
return zerr // TODO send the error to M ?
}
err = req.Reply(&proto.AnswerLastIDs{LastTid: lastTid, LastOid: lastOid})
......@@ -287,18 +287,19 @@ func (stor *Storage) serve(ctx context.Context) (err error) {
wg.Add(1)
go func() {
defer wg.Done()
err := stor.serveLink(ctx, req, idReq) // XXX ignore err? -> logged
// XXX log err XXX vvv ok?
switch errors.Cause(err) {
// XXX closed by main or peer down - all logged by main called
// XXX review
case neonet.ErrLinkDown, neonet.ErrLinkClosed:
// ok
default:
log.Error(ctx, err)
err := stor.serveLink(ctx, req, idReq)
if err != nil {
// XXX log err XXX vvv ok?
switch errors.Cause(err) {
// XXX closed by main or peer down - all logged by main called
// XXX review
case neonet.ErrLinkDown, neonet.ErrLinkClosed:
// ok
default:
log.Error(ctx, err)
}
}
return
}()
}
}
......@@ -359,16 +360,6 @@ func (stor *Storage) serveLink(ctx context.Context, req *neonet.Request, idReq *
for {
req, err := link.Recv1()
if err != nil {
switch errors.Cause(err) {
// XXX closed by main or peer down
// XXX review
case neonet.ErrLinkDown, neonet.ErrLinkClosed:
log.Info(ctx, err)
// ok
default:
log.Error(ctx, err)
}
return err
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment