From c294bedb217f31da06a3bd39bf97c35a919b3f77 Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Tue, 30 Aug 2022 17:43:59 -0400 Subject: [PATCH] fix(server): for putipns requests send errors back to the client --- server.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server.go b/server.go index ee3b030..a38b669 100644 --- a/server.go +++ b/server.go @@ -242,7 +242,11 @@ func (d *delegatedRoutingProxy) GetIPNS(ctx context.Context, id []byte) (<-chan func (d *delegatedRoutingProxy) PutIPNS(ctx context.Context, id []byte, record []byte) (<-chan drc.PutIPNSAsyncResult, error) { ctx, cancel := context.WithCancel(ctx) defer cancel() - return nil, d.dht.PutValue(ctx, ipns.RecordKey(peer.ID(id)), record) + err := d.dht.PutValue(ctx, ipns.RecordKey(peer.ID(id)), record) + ch := make(chan drc.PutIPNSAsyncResult, 1) + ch <- drc.PutIPNSAsyncResult{Err: err} + close(ch) + return ch, nil } var _ drs.DelegatedRoutingService = (*delegatedRoutingProxy)(nil)