Skip to content

Commit

Permalink
fix(server): for putipns requests send errors back to the client
Browse files Browse the repository at this point in the history
  • Loading branch information
aschmahmann committed Aug 30, 2022
1 parent 14f45a8 commit c294bed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c294bed

Please sign in to comment.