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 ...@@ -185,7 +185,7 @@ func (stor *Storage) m1initialize1(ctx context.Context, req neonet.Request) erro
lastTid, zerr1 := stor.back.LastTid(ctx) lastTid, zerr1 := stor.back.LastTid(ctx)
lastOid, zerr2 := stor.back.LastOid(ctx) lastOid, zerr2 := stor.back.LastOid(ctx)
if zerr := xerr.First(zerr1, zerr2); zerr != nil { 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}) err = req.Reply(&proto.AnswerLastIDs{LastTid: lastTid, LastOid: lastOid})
...@@ -287,7 +287,8 @@ func (stor *Storage) serve(ctx context.Context) (err error) { ...@@ -287,7 +287,8 @@ func (stor *Storage) serve(ctx context.Context) (err error) {
wg.Add(1) wg.Add(1)
go func() { go func() {
defer wg.Done() defer wg.Done()
err := stor.serveLink(ctx, req, idReq) // XXX ignore err? -> logged err := stor.serveLink(ctx, req, idReq)
if err != nil {
// XXX log err XXX vvv ok? // XXX log err XXX vvv ok?
switch errors.Cause(err) { switch errors.Cause(err) {
// XXX closed by main or peer down - all logged by main called // XXX closed by main or peer down - all logged by main called
...@@ -298,7 +299,7 @@ func (stor *Storage) serve(ctx context.Context) (err error) { ...@@ -298,7 +299,7 @@ func (stor *Storage) serve(ctx context.Context) (err error) {
default: default:
log.Error(ctx, err) log.Error(ctx, err)
} }
return }
}() }()
} }
} }
...@@ -359,16 +360,6 @@ func (stor *Storage) serveLink(ctx context.Context, req *neonet.Request, idReq * ...@@ -359,16 +360,6 @@ func (stor *Storage) serveLink(ctx context.Context, req *neonet.Request, idReq *
for { for {
req, err := link.Recv1() req, err := link.Recv1()
if err != nil { 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 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